aboutsummaryrefslogtreecommitdiffstats
path: root/builtin.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2021-01-09 22:32:45 +0200
committerArnold D. Robbins <arnold@skeeve.com>2021-01-09 22:32:45 +0200
commitd3a1acac12673875b21ad2a95ffd7be0fb220ae5 (patch)
tree84aedd316fb0ff4d302b403d8d6977b6834777ce /builtin.c
parent32a9f7f24000827da433b89de7c24c5d95a561c6 (diff)
parent073460dda1b24bcb872186a0818859a6ccba727d (diff)
downloadegawk-d3a1acac12673875b21ad2a95ffd7be0fb220ae5.tar.gz
egawk-d3a1acac12673875b21ad2a95ffd7be0fb220ae5.tar.bz2
egawk-d3a1acac12673875b21ad2a95ffd7be0fb220ae5.zip
Merge branch 'gawk-5.1-stable'
Diffstat (limited to 'builtin.c')
-rw-r--r--builtin.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/builtin.c b/builtin.c
index 867a07f9..1b612f4a 100644
--- a/builtin.c
+++ b/builtin.c
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 1986, 1988, 1989, 1991-2020,
+ * Copyright (C) 1986, 1988, 1989, 1991-2021,
* the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
@@ -3684,7 +3684,9 @@ nondec2awknum(char *str, size_t len, char **endptr)
if (endptr)
*endptr = str;
} else if (len >= 1 && *str == '0') {
- for (; len > 0; len--) {
+ int l;
+ // preserve len in case we go to decimal
+ for (l = len; l > 0; l--) {
if (! isdigit((unsigned char) *str)) {
if (endptr)
*endptr = str;