]> git.proxmox.com Git - mirror_frr.git/blobdiff - lib/ntop.c
Merge pull request #10816 from anlancs/fix-bgdp-local-es-rt
[mirror_frr.git] / lib / ntop.c
index ccbf8793d38e2ce3fd3b208f87b6eacaebbea3bf..1b2dd7a6d12da7be9afbc9e79cb494ea3ab1cdee 100644 (file)
@@ -40,14 +40,18 @@ static inline void putbyte(uint8_t bytex, char **posx)
        bool zero = false;
        int byte = bytex, tmp, a, b;
 
-       if ((tmp = byte - 200) >= 0) {
+       tmp = byte - 200;
+       if (tmp >= 0) {
                *pos++ = '2';
                zero = true;
                byte = tmp;
-       } else if ((tmp = byte - 100) >= 0) {
-               *pos++ = '1';
-               zero = true;
-               byte = tmp;
+       } else {
+               tmp = byte - 100;
+               if (tmp >= 0) {
+                       *pos++ = '1';
+                       zero = true;
+                       byte = tmp;
+               }
        }
 
        /* make sure the compiler knows the value range of "byte" */