clausklein / rpms / tftp

Forked from rpms/tftp 5 years ago
Clone

Blame SOURCES/tftp-rewrite-macro.patch

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