]> gapil.gnulinux.it Git - gapil.git/commitdiff
Small corrections to code, removing warnings. master
authorSimone Piccardi <piccardi@gnulinux.it>
Mon, 8 Dec 2025 21:46:10 +0000 (22:46 +0100)
committerSimone Piccardi <piccardi@gnulinux.it>
Mon, 8 Dec 2025 21:46:10 +0000 (22:46 +0100)
sources/TCP_echod.c
sources/TestRen.c
sources/getcap.c

index 333a5450b9df067e62444a8e36b646e112982e7c..eca1d15bd8915bdb6d1fe8ca7f0adec04d99df37 100644 (file)
@@ -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 {
index c6a3fba944853f38948367414835d772f013676d..f5d5d226c2aee41c623a70640d3dd86d83463cba 100644 (file)
@@ -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);
     }
index ad2e354e15281d415a7145b30baa648ac2c34c0d..b945a6074bd7453b2430b24e9c515a4b4b79201b 100644 (file)
@@ -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