From 7450bd283f0082fe1b3499142ad5273067db70c6 Mon Sep 17 00:00:00 2001 From: Michael Roitzsch Date: Tue, 27 Jul 2004 18:06:45 +0000 Subject: from the docs of sprintf: "when the strings overlap, the behaviour is undefined" (actually it works with glibc and sprintf, but not with snprintf) CVS patchset: 6859 CVS date: 2004/07/27 18:06:45 --- misc/cdda_server.c | 2 +- misc/libdvdcss-1.2.6-network.patch | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'misc') diff --git a/misc/cdda_server.c b/misc/cdda_server.c index d054f23be..d927113c0 100644 --- a/misc/cdda_server.c +++ b/misc/cdda_server.c @@ -317,7 +317,7 @@ int sock_string_write(int socket, char *msg, ...) { /* Each line sent is '\n' terminated */ if((buf[strlen(buf)] == '\0') && (buf[strlen(buf) - 1] != '\n')) - sprintf(buf, "%s%c", buf, '\n'); + strcat(buf, "\n"); return sock_data_write(socket, buf, strlen(buf)); } diff --git a/misc/libdvdcss-1.2.6-network.patch b/misc/libdvdcss-1.2.6-network.patch index 18fbc3652..cf23ba6ff 100644 --- a/misc/libdvdcss-1.2.6-network.patch +++ b/misc/libdvdcss-1.2.6-network.patch @@ -432,7 +432,7 @@ diff -u --new-file libdvdcss-1.2.6/src/network.c libdvdcss-1.2.6-network/src/net + + /* Each line sent is '\n' terminated */ + if((buf[strlen(buf)] == '\0') && (buf[strlen(buf) - 1] != '\n')) -+ sprintf(buf, "%s%c", buf, '\n'); ++ strcat(buf, "\n"); + + if( sock_data_write(socket, buf, strlen(buf)) < (int)strlen(buf) ) + { -- cgit v1.2.3