From 876884e8f974bdfa015adf49a255bee45cc3c893 Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Mon, 9 Aug 2021 16:26:15 +0200 Subject: scan_int64: don't assume long fits 64-bits --- hittpd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'hittpd.c') 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; -- cgit 1.4.1