summaryrefslogtreecommitdiffstats
path: root/usr.sbin/eigrpd
diff options
context:
space:
mode:
authorgsoares <gsoares@openbsd.org>2016-10-10 02:26:24 +0000
committergsoares <gsoares@openbsd.org>2016-10-10 02:26:24 +0000
commite7b69599b7fb052bff6e0f0f33ca074733ffa137 (patch)
tree6eca63eaec55147df01efbbaf2c13d6b7a7a547b /usr.sbin/eigrpd
parentcalls to uname(3) should be checked against non-negative value (diff)
downloadwireguard-openbsd-e7b69599b7fb052bff6e0f0f33ca074733ffa137.tar.xz
wireguard-openbsd-e7b69599b7fb052bff6e0f0f33ca074733ffa137.zip
calls to uname(3) should be checked against non-negative value
upon successful and -1 on failure (as per POSIX). No functional change, just improves portability. requested by guenther@ looks correct to schwarze@ OK renato@
Diffstat (limited to 'usr.sbin/eigrpd')
-rw-r--r--usr.sbin/eigrpd/tlv.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/eigrpd/tlv.c b/usr.sbin/eigrpd/tlv.c
index 464ddd75e39..3e64c5317e9 100644
--- a/usr.sbin/eigrpd/tlv.c
+++ b/usr.sbin/eigrpd/tlv.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tlv.c,v 1.14 2016/09/02 16:46:29 renato Exp $ */
+/* $OpenBSD: tlv.c,v 1.15 2016/10/10 02:26:24 gsoares Exp $ */
/*
* Copyright (c) 2015 Renato Westphal <renato@openbsd.org>
@@ -103,7 +103,7 @@ gen_sw_version_tlv(struct ibuf *buf)
memset(&ts, 0, sizeof(ts));
ts.type = htons(TLV_TYPE_SW_VERSION);
ts.length = htons(TLV_TYPE_SW_VERSION_LEN);
- if (uname(&u) == 0) {
+ if (uname(&u) >= 0) {
if (sscanf(u.release, "%u.%u", &vendor_os_major,
&vendor_os_minor) == 2) {
ts.vendor_os_major = (uint8_t) vendor_os_major;