summary refs log tree commit diff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2021-08-09 16:26:15 +0200
committerLeah Neukirchen <leah@vuxu.org>2021-08-09 16:26:15 +0200
commit876884e8f974bdfa015adf49a255bee45cc3c893 (patch)
tree98c973a3151e978936dca5c4c5c173fbf78a749f
parent9ef7db6ff9767a594869790f1868288a495d471a (diff)
downloadhittpd-876884e8f974bdfa015adf49a255bee45cc3c893.tar.gz
hittpd-876884e8f974bdfa015adf49a255bee45cc3c893.tar.xz
hittpd-876884e8f974bdfa015adf49a255bee45cc3c893.zip
scan_int64: don't assume long fits 64-bits
-rw-r--r--hittpd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hittpd.c b/hittpd.c
index 64e552a..554ed0d 100644
--- a/hittpd.c
+++ b/hittpd.c
@@ -141,8 +141,8 @@ on_header_field(http_parser *p, const char *s, size_t l)
 
 int scan_int64(const char **s, int64_t *u) {
 	const char *t = *s;
-	long x;
-	for (x = 0; *t && (unsigned)(*t)-'0' < 10 && x <= LLONG_MAX/10 - 1; t++)
+	int64_t x;
+	for (x = 0; *t && (unsigned)(*t)-'0' < 10 && x <= INT64_MAX/10 - 1; t++)
 		x = x * 10 + ((*t)-'0');
 	if (t != *s) {
 		*s = t;