summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-07-28 10:26:06 -0400
committerNick Mathewson <nickm@torproject.org>2017-07-28 10:26:06 -0400
commitaccb734c5fc45481231b837cae1244129144df06 (patch)
treea3529a4cc1f47b947e2af75d62de03f546d15d1f
parentdecb9276852b4cb7f9f2472c81cd47fbab60845f (diff)
downloadtor-accb734c5fc45481231b837cae1244129144df06.tar.gz
tor-accb734c5fc45481231b837cae1244129144df06.zip
Turn base < 0 into a BUG() in our long-parse functions.
-rw-r--r--src/common/util.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/common/util.c b/src/common/util.c
index 5b47028097..0858d17fe6 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -1172,7 +1172,7 @@ tor_parse_long(const char *s, int base, long min, long max,
char *endptr;
long r;
- if (base < 0) {
+ if (BUG(base < 0)) {
if (ok)
*ok = 0;
return 0;
@@ -1191,7 +1191,7 @@ tor_parse_ulong(const char *s, int base, unsigned long min,
char *endptr;
unsigned long r;
- if (base < 0) {
+ if (BUG(base < 0)) {
if (ok)
*ok = 0;
return 0;
@@ -1223,7 +1223,7 @@ tor_parse_uint64(const char *s, int base, uint64_t min,
char *endptr;
uint64_t r;
- if (base < 0) {
+ if (BUG(base < 0)) {
if (ok)
*ok = 0;
return 0;