[PATCH 05/10] parse-date: use uintmax_t where appropriate

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Reported-by: Ruediger Meier <ruediger.meier@xxxxxxxxxxx>
Influenced-by: gnulib 30784c4 Paul Eggert <eggert@xxxxxxxxxxx>
Signed-off-by: J William Piggott <elseifthen@xxxxxxx>
---
 lib/parse-date.y | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/parse-date.y b/lib/parse-date.y
index b79b333..a8f710c 100644
--- a/lib/parse-date.y
+++ b/lib/parse-date.y
@@ -1061,7 +1061,7 @@ static int yylex (union YYSTYPE *lvalp, parser_control *pc)
 		if (c_isdigit (c) || c == '-' || c == '+') {
 			char const *p;
 			int sign;
-			unsigned long int value;
+			uintmax_t value;
 			if (c == '-' || c == '+') {
 				sign = c == '-' ? -1 : 1;
 				while (c = *++pc->input, c_isspace (c))
@@ -1073,21 +1073,21 @@ static int yylex (union YYSTYPE *lvalp, parser_control *pc)
 				sign = 0;
 			p = pc->input;
 			for (value = 0; ; value *= 10) {
-				unsigned long int value1 = value + (c - '0');
+				uintmax_t value1 = value + (c - '0');
 				if (value1 < value)
 					return '?';
 				value = value1;
 				c = *++p;
 				if (! c_isdigit (c))
 					break;
-				if (ULONG_MAX / 10 < value)
+				if (UINTMAX_MAX / 10 < value)
 					return '?';
 			}
 			if ((c == '.' || c == ',') && c_isdigit (p[1])) {
 				time_t s;
 				int ns;
 				int digits;
-				unsigned long int value1;
+				uintmax_t value1;
 
 				/* Check for overflow when converting value to
 				 * time_t.
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux