From d4f77ba2e1726dafd5cdb9ff9dcd8f77e1ddb52b Mon Sep 17 00:00:00 2001 From: "tim.schubert@tu-bs.de" Date: Sat, 29 Oct 2016 23:20:01 +0200 Subject: [PATCH] Fix format string for sscanf. --- netcalc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netcalc.c b/netcalc.c index 225b4ea..dda823f 100644 --- a/netcalc.c +++ b/netcalc.c @@ -132,7 +132,7 @@ int parse(char *buf, size_t buflen, unsigned int *first, unsigned int *second, c char *num2str = NULL; char *opstr = NULL; - ssize_t num_items = sscanf(buf, "%m[x,0-9,A-F,b]%m[+,-,*,/]%m[x,0-9,A-F,b]", &num1str, &opstr, &num2str); + ssize_t num_items = sscanf(buf, "%m[x0-9A-Fb]%m[+-*/]%m[x0-9A-Fb]", &num1str, &opstr, &num2str); int status = 0; if (num_items < 3) {