aboutsummaryrefslogtreecommitdiff
path: root/src/common/util.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2009-08-31 00:18:55 -0400
committerNick Mathewson <nickm@torproject.org>2009-08-31 00:18:55 -0400
commit00b37f071d2c96612892340f5f883b869033d6a1 (patch)
tree35d484780d5ca53aae43a5a90e9d032c6b1c08a5 /src/common/util.h
parent0bb59f1c38eef467a353faf1a30cf93b64209a27 (diff)
downloadtor-00b37f071d2c96612892340f5f883b869033d6a1.tar.gz
tor-00b37f071d2c96612892340f5f883b869033d6a1.zip
Revise parsing of time and memory units to handle spaces.
When we added support for fractional units (like 1.5 MB) I broke support for giving units with no space (like 2MB). This patch should fix that. It also adds a propoer tor_parse_double(). Fix for bug 1076. Bugfix on 0.2.2.1-alpha.
Diffstat (limited to 'src/common/util.h')
-rw-r--r--src/common/util.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/common/util.h b/src/common/util.h
index c7741a64ac..bb384a2a33 100644
--- a/src/common/util.h
+++ b/src/common/util.h
@@ -182,6 +182,8 @@ long tor_parse_long(const char *s, int base, long min,
long max, int *ok, char **next);
unsigned long tor_parse_ulong(const char *s, int base, unsigned long min,
unsigned long max, int *ok, char **next);
+double tor_parse_double(const char *s, double min, double max, int *ok,
+ char **next);
uint64_t tor_parse_uint64(const char *s, int base, uint64_t min,
uint64_t max, int *ok, char **next);
const char *hex_str(const char *from, size_t fromlen) ATTR_NONNULL((1));