clausklein / rpms / tftp

Forked from rpms/tftp 5 years ago
Clone
361352
Resolves: #1485943
361352
361352
--- a/tftpd/tftpd.c       2017-08-28 09:12:11.681299000 +0200
361352
+++ b/tftpd/tftpd.c       2017-08-28 13:30:03.109312000 +0200
361352
@@ -1388,24 +1388,25 @@
361352
             return strlen(p);
361352
 
361352
     case 'x':
361352
-        if (output) {
361352
-            if (from.sa.sa_family == AF_INET) {
361352
+        if (from.sa.sa_family == AF_INET) {
361352
+            if (output) {
361352
                 sprintf(output, "%08lX",
361352
                     (unsigned long)ntohl(from.si.sin_addr.s_addr));
361352
-                l = 8;
361352
+            }
361352
+            l = 8;
361352
 #ifdef HAVE_IPV6
361352
-            } else {
361352
-                unsigned char *c = (unsigned char *)SOCKADDR_P(&from;;
361352
-                p = tb;
361352
-                for (l = 0; l < 16; l++) {
361352
-                    sprintf(p, "%02X", *c);
361352
-                    c++;
361352
-                    p += 2;
361352
-                }
361352
+        } else {
361352
+            unsigned char *c = (unsigned char *)SOCKADDR_P(&from;;
361352
+            p = tb;
361352
+            for (l = 0; l < 16; l++) {
361352
+                sprintf(p, "%02X", *c);
361352
+                c++;
361352
+                p += 2;
361352
+            }
361352
+            if (output)
361352
                 strcpy(output, tb);
361352
-                l = strlen(tb);
361352
+            l = strlen(tb);
361352
 #endif
361352
-            }
361352
         }
361352
         return l;
361352
 
361352