summaryrefslogtreecommitdiff
path: root/lib/ntop.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2021-07-06 09:47:41 -0400
committerGitHub <noreply@github.com>2021-07-06 09:47:41 -0400
commitacb4c44ef8da8c1a155184a809647533237adca9 (patch)
tree66c81b756c79ff507088d82ccc2bea4614b3a300 /lib/ntop.c
parent4afc3218254264c20b38b32b085b430c34a86c24 (diff)
parente702605d80c26e94681b282d97c726df6c6871da (diff)
Merge pull request #8942 from ton31337/fix/cleanups_2
Another round of cleanup
Diffstat (limited to 'lib/ntop.c')
-rw-r--r--lib/ntop.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/ntop.c b/lib/ntop.c
index ccbf8793d3..1b2dd7a6d1 100644
--- a/lib/ntop.c
+++ b/lib/ntop.c
@@ -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" */