Andrew's git
/
gitweb.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
commit
grep
author
committer
pickaxe
?
re
Merge branch 'jk/asciidoctor-section-heading-markup-fix'
[gitweb.git]
/
git-compat-util.h
diff --git
a/git-compat-util.h
b/git-compat-util.h
index f649e81f1107722f4c7d051201920ae2a0e7846a..1df82fa598daa131c9e84023083a014ac3ee3f9f 100644
(file)
--- a/
git-compat-util.h
+++ b/
git-compat-util.h
@@
-814,6
+814,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;