aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/socket.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2016-08-22 14:28:57 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2016-08-22 14:28:57 +0200
commit528ec099b1e369e8f91342c9d3a421646e34ef1a (patch)
tree600a8945aa055199e4b18ee462f0d6cf389411e9 /src/socket.c
parentroutingtable: hyphen was ugly (diff)
downloadwireguard-monolithic-historical-528ec099b1e369e8f91342c9d3a421646e34ef1a.tar.xz
wireguard-monolithic-historical-528ec099b1e369e8f91342c9d3a421646e34ef1a.zip
socket: use isdigit
Diffstat (limited to 'src/socket.c')
-rw-r--r--src/socket.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/socket.c b/src/socket.c
index aa17c1b..4720d4a 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -5,6 +5,7 @@
#include "packets.h"
#include "messages.h"
+#include <linux/ctype.h>
#include <linux/net.h>
#include <linux/if_vlan.h>
#include <linux/if_ether.h>
@@ -364,7 +365,7 @@ static uint16_t generate_default_incoming_port(struct wireguard_device *wg)
return port;
digit_begin = name + len - 1;
while (digit_begin >= name) {
- if (*digit_begin >= '0' && *digit_begin <= '9')
+ if (isdigit(*digit_begin))
--digit_begin;
else
break;