Ticket #22157: patch-src-lib-xmmsipc-socket_unix.c.diff

File patch-src-lib-xmmsipc-socket_unix.c.diff, 890 bytes (added by manphiz@…, 15 years ago)

This patch is supposed to be put in "files", which fixes a bug that causes "Abort trap" when using xmms2. See http://bugs.xmms2.xmms.se/view.php?id=2263 and http://bugs.xmms2.xmms.se/view.php?id=2274

  • src/lib/xmmsipc/socket_unix.c

    diff -urN xmms2-0.6DrMattDestruction/src/lib/xmmsipc/socket_unix.c xmms2-0.6DrMattDestruction.new/src/lib/xmmsipc/socket_unix.c
    old new  
    8282        }
    8383
    8484        saddr.sun_family = AF_UNIX;
    85         snprintf (saddr.sun_path, 108, "/%s", url->path);
     85        snprintf (saddr.sun_path, sizeof(saddr.sun_path), "/%s", url->path);
    8686
    8787        if (connect (fd, (struct sockaddr *) &saddr, sizeof (saddr)) == -1) {
    8888                close (fd);
     
    173173        }
    174174
    175175        saddr.sun_family = AF_UNIX;
    176         snprintf (saddr.sun_path, 108, "/%s", url->path);
     176        snprintf (saddr.sun_path, sizeof(saddr.sun_path), "/%s", url->path);
    177177
    178178        if (access (saddr.sun_path, F_OK) == 0) {
    179179                if (connect (fd, (struct sockaddr *) &saddr, sizeof (saddr)) != -1) {