projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
862fe2e
)
common.c: remove always true comparison
author
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Tue, 13 Aug 2019 09:26:50 +0000
(11:26 +0200)
committer
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Tue, 13 Aug 2019 09:26:50 +0000
(11:26 +0200)
ntohs() returns an uint16_t, which is always less than 65535
src/utils/common/common.c
patch
|
blob
|
history
diff --git
a/src/utils/common/common.c
b/src/utils/common/common.c
index
7cfd310
..
2d961d4
100644
(file)
--- a/
src/utils/common/common.c
+++ b/
src/utils/common/common.c
@@
-1456,13
+1456,13
@@
int service_name_to_port_number(const char *service_name) {
service_number = (int)ntohs(sa->sin6_port);
}
- if (
(service_number > 0) && (service_number <= 65535)
)
+ if (
service_number > 0
)
break;
}
freeaddrinfo(ai_list);
- if (
(service_number > 0) && (service_number <= 65535)
)
+ if (
service_number > 0
)
return service_number;
return -1;
} /* int service_name_to_port_number */