summaryrefslogtreecommitdiff
path: root/audio/gtkmserv/patches/patch-ab
blob: a7c7dcf5057f149b172e9e03207a8cf8bc2c1b35 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
$NetBSD: patch-ab,v 1.1 2009/03/13 14:34:21 martin Exp $

# Fix obvious C bugs and calm a warning. Without this, the app shows
# bogus "last played" times and dies imediately with a bus error on
# alignement critical bugs.

--- mserv.c.orig	2001-01-28 20:11:21.000000000 +0100
+++ mserv.c	2009-03-13 15:11:04.000000000 +0100
@@ -43,7 +43,7 @@ void mserv_connect(void)
       return;
    }
 
-   if (connect(Session.socket, &sin, sizeof(sin)) == -1)
+   if (connect(Session.socket, (struct sockaddr *)&sin, sizeof(sin)) == -1)
    {
       strcat(buf, strerror(errno));
       printf("Can't make Connection: (%d): %s\n", errno, buf);
@@ -226,7 +226,8 @@ void mserv_key_next_song(char *data)
 
 void mserv_key_update_status(char *data)
 {
-   char *token;
+   char *token, *endp;
+   time_t t;
 
    if (!Session.StatusWin.window)
       return;
@@ -253,8 +254,9 @@ void mserv_key_update_status(char *data)
    gtk_entry_set_text(GTK_ENTRY(Session.StatusWin.Song), token);
 
    token = strtok(NULL, "\t");
+   t = strtoull(token, &endp, 10);
    gtk_entry_set_text(GTK_ENTRY(Session.StatusWin.Last_Played),
-		      ctime((const time_t *)token));
+		      ctime(&t));
    token = strtok(NULL, "\t");
    gtk_entry_set_text(GTK_ENTRY(Session.StatusWin.Length), token);