From 5ff1caf38c2349b8d7bbaa794130e19430b01347 Mon Sep 17 00:00:00 2001 From: yhirose Date: Fri, 24 Jan 2020 16:07:01 -0500 Subject: [PATCH] Fixed int overflow problem --- peglib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/peglib.h b/peglib.h index 1369fd4..f29ba1d 100644 --- a/peglib.h +++ b/peglib.h @@ -441,7 +441,7 @@ inline std::pair line_info(const char* start, const char* cur) { /* * String tag */ -inline constexpr unsigned int str2tag(const char* str, int h = 0) { +inline constexpr unsigned int str2tag(const char* str, unsigned int h = 0) { return (*str == '\0') ? h : str2tag(str + 1, (h * 33) ^ static_cast(*str)); }