aboutsummaryrefslogtreecommitdiffstats
path: root/src/util.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2017-07-25 22:12:23 +0200
committerMattias Andrée <maandree@kth.se>2017-07-25 22:12:23 +0200
commit835df7bd1e81852062dd70ce1a054fc9b510e50f (patch)
treede418467fc318adfcf5e3fdd8e75ea2a055386c9 /src/util.c
parentAdd ability to choose korn shell implementation (diff)
downloadblind-835df7bd1e81852062dd70ce1a054fc9b510e50f.tar.gz
blind-835df7bd1e81852062dd70ce1a054fc9b510e50f.tar.bz2
blind-835df7bd1e81852062dd70ce1a054fc9b510e50f.tar.xz
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
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c5
1 files changed, 5 insertions, 0 deletions
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')