From: Simone Piccardi Date: Mon, 8 Dec 2025 21:46:10 +0000 (+0100) Subject: Small corrections to code, removing warnings. X-Git-Url: https://gapil.gnulinux.it/gitweb/?a=commitdiff_plain;h=a09e004fbb12e9cde128bb8c9ce36d63b4270fcf;p=gapil.git Small corrections to code, removing warnings. --- diff --git a/sources/TCP_echod.c b/sources/TCP_echod.c index 333a545..eca1d15 100644 --- a/sources/TCP_echod.c +++ b/sources/TCP_echod.c @@ -217,7 +217,7 @@ void usage(void) { void ServEcho(int sockfd) { char buffer[MAXLINE]; int nread, nwrite; - char debug[MAXLINE+20]; + char debug[MAXLINE+30]; /* main loop, reading 0 char means client close connection */ while ( (nread = read(sockfd, buffer, MAXLINE)) != 0) { if (nread < 0) { @@ -231,7 +231,7 @@ void ServEcho(int sockfd) { } if (debugging) { buffer[nread] = 0; - snprintf(debug, MAXLINE+20, "Letti %d byte, %s", nread, buffer); + snprintf(debug, MAXLINE+30, "Letti %d byte, %s", nread, buffer); if (demonize) { /* daemon mode */ syslog(LOG_DEBUG, debug); } else { diff --git a/sources/TestRen.c b/sources/TestRen.c index c6a3fba..f5d5d22 100644 --- a/sources/TestRen.c +++ b/sources/TestRen.c @@ -83,7 +83,6 @@ int main(int argc, char *argv[]) usage(); } if ( rename(argv[optind], argv[optind+1]) ) { - copy = strerror_r(errno, NULL, 0); perror("cannot rename"); exit(1); } diff --git a/sources/getcap.c b/sources/getcap.c index ad2e354..b945a60 100644 --- a/sources/getcap.c +++ b/sources/getcap.c @@ -51,7 +51,6 @@ int main(int argc, char *argv[]) pid_t pid = 0; cap_t capab; char *string; - int res; /* * Input section: decode command line parameters