diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2021-09-12 09:57:03 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2021-09-12 09:57:03 +0300 |
commit | 6d200ac046e3869af946e2e8c4f58948888c3f8e (patch) | |
tree | 4f3b9ca8ab26b82f37bc416c8ee86c26468c3ad7 /builtin.c | |
parent | b1ce5f1df79cea7e3d46183bffcac81c7ce287dd (diff) | |
parent | 0bc02532d7fa333ac7067c1cb91506ad16485916 (diff) | |
download | egawk-6d200ac046e3869af946e2e8c4f58948888c3f8e.tar.gz egawk-6d200ac046e3869af946e2e8c4f58948888c3f8e.tar.bz2 egawk-6d200ac046e3869af946e2e8c4f58948888c3f8e.zip |
Merge branch 'gawk-5.1-stable'
Diffstat (limited to 'builtin.c')
-rw-r--r-- | builtin.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -4437,9 +4437,10 @@ add_thousands(const char *original, struct lconv *loc) if (loc->grouping[ii] && ++jj == loc->grouping[ii]) { if (src >= original) { /* only add if more digits coming */ const char *ts = loc->thousands_sep; + int k; - while (*ts != '\0') - *dest++ = *ts++; + for (k = strlen(ts) - 1; k >= 0; k--) + *dest++ = ts[k]; } if (loc->grouping[ii+1] == 0) jj = 0; /* keep using current val in loc.grouping[ii] */ |