Andrew's git
/
gitweb.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
commit
grep
author
committer
pickaxe
?
re
tag.c: use 'ref-filter' data structures
[gitweb.git]
/
git-compat-util.h
diff --git
a/git-compat-util.h
b/git-compat-util.h
index c6d391f86490b94e4df667d64d54323e1915c477..4515c494ee3873c0668be9d52892b14386390b7e 100644
(file)
--- a/
git-compat-util.h
+++ b/
git-compat-util.h
@@
-812,6
+812,9
@@
static inline int strtoul_ui(char const *s, int base, unsigned int *result)
char *p;
errno = 0;
+ /* negative values would be accepted by strtoul */
+ if (strchr(s, '-'))
+ return -1;
ul = strtoul(s, &p, base);
if (errno || *p || p == s || (unsigned int) ul != ul)
return -1;