diff options
author | 2003-05-30 21:16:50 +0000 | |
---|---|---|
committer | 2003-05-30 21:16:50 +0000 | |
commit | 6c99d9c2341dc9e9c577a5f94ff73af1c94838af (patch) | |
tree | ce4d49dcf22f3848e338b3a49c8b1e9f42589a67 | |
parent | KNF & ANSI, jason agrees (diff) | |
download | wireguard-openbsd-6c99d9c2341dc9e9c577a5f94ff73af1c94838af.tar.xz wireguard-openbsd-6c99d9c2341dc9e9c577a5f94ff73af1c94838af.zip |
o timeout is int, not u_int32_t
o reject negative timeouts
ok jason@
-rw-r--r-- | sbin/brconfig/brconfig.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sbin/brconfig/brconfig.c b/sbin/brconfig/brconfig.c index 6487c1d6a3e..fb801a02e48 100644 --- a/sbin/brconfig/brconfig.c +++ b/sbin/brconfig/brconfig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: brconfig.c,v 1.23 2002/12/18 16:10:27 markus Exp $ */ +/* $OpenBSD: brconfig.c,v 1.24 2003/05/30 21:16:50 henning Exp $ */ /* * Copyright (c) 1999, 2000 Jason L. Wright (jason@thought.net) @@ -739,12 +739,12 @@ int bridge_timeout(int s, char *brdg, char *arg) { struct ifbrparam bp; - u_int32_t newtime; + int newtime; char *endptr; errno = 0; - newtime = strtoul(arg, &endptr, 0); - if (arg[0] == '\0' || endptr[0] != '\0' || + newtime = strtol(arg, &endptr, 0); + if (arg[0] == '\0' || endptr[0] != '\0' || newtime < 0 || (errno == ERANGE && newtime == ULONG_MAX)) { printf("invalid arg for timeout: %s\n", arg); return (EX_USAGE); |