pkgsrc - initial commit
[pkgsrc.git] / audio / gtkmserv / patches / patch-ab
1 $NetBSD: patch-ab,v 1.1 2009/03/13 14:34:21 martin Exp $
2
3 # Fix obvious C bugs and calm a warning. Without this, the app shows
4 # bogus "last played" times and dies imediately with a bus error on
5 # alignement critical bugs.
6
7 --- mserv.c.orig        2001-01-28 20:11:21.000000000 +0100
8 +++ mserv.c     2009-03-13 15:11:04.000000000 +0100
9 @@ -43,7 +43,7 @@ void mserv_connect(void)
10        return;
11     }
12  
13 -   if (connect(Session.socket, &sin, sizeof(sin)) == -1)
14 +   if (connect(Session.socket, (struct sockaddr *)&sin, sizeof(sin)) == -1)
15     {
16        strcat(buf, strerror(errno));
17        printf("Can't make Connection: (%d): %s\n", errno, buf);
18 @@ -226,7 +226,8 @@ void mserv_key_next_song(char *data)
19  
20  void mserv_key_update_status(char *data)
21  {
22 -   char *token;
23 +   char *token, *endp;
24 +   time_t t;
25  
26     if (!Session.StatusWin.window)
27        return;
28 @@ -253,8 +254,9 @@ void mserv_key_update_status(char *data)
29     gtk_entry_set_text(GTK_ENTRY(Session.StatusWin.Song), token);
30  
31     token = strtok(NULL, "\t");
32 +   t = strtoull(token, &endp, 10);
33     gtk_entry_set_text(GTK_ENTRY(Session.StatusWin.Last_Played),
34 -                     ctime((const time_t *)token));
35 +                     ctime(&t));
36     token = strtok(NULL, "\t");
37     gtk_entry_set_text(GTK_ENTRY(Session.StatusWin.Length), token);
38