From 835df7bd1e81852062dd70ce1a054fc9b510e50f Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 25 Jul 2017 22:12:23 +0200 Subject: Fix blind-kernel and blind-temporal-mean,d add blind-{spatial,temporal}-arithm and blind-spatial-mean, and add support for multiple streams in blind-arithm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/util.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/util.c') diff --git a/src/util.c b/src/util.c index 3fc3716..41d8104 100644 --- a/src/util.c +++ b/src/util.c @@ -32,6 +32,11 @@ tollu(const char *s, unsigned long long int min, unsigned long long int max, uns errno = ERANGE; return -1; } + if (!isdigit(s[*s == 'x' || *s == 'X' || *s == '#']) || + (*s == '0' && !isdigit(s[1 + (*s == 'x' || *s == 'o' || *s == 'b')]))) { + errno = EINVAL; + return -1; + } if (tolower(*s) == 'x' || *s == '#') *out = strtoull(s + 1, &end, 16); else if (*s == '0' && tolower(s[1]) == 'x') -- cgit v1.2.3-70-g09d2