aboutsummaryrefslogtreecommitdiffstats
path: root/builtin.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2014-07-10 15:40:23 -0700
committerArnold D. Robbins <arnold@skeeve.com>2014-07-10 15:40:23 -0700
commit9a5b89ce4cf173a7e23d9b196a2d7dee9ec2d2f0 (patch)
tree1120c348785a755116fb9eb74d127442fc26ed97 /builtin.c
parentbd29e4330190f4ce26dc1f734229357b6f248a1a (diff)
downloadegawk-9a5b89ce4cf173a7e23d9b196a2d7dee9ec2d2f0.tar.gz
egawk-9a5b89ce4cf173a7e23d9b196a2d7dee9ec2d2f0.tar.bz2
egawk-9a5b89ce4cf173a7e23d9b196a2d7dee9ec2d2f0.zip
Bug fix when sprintf %c on huge values in multibyte locales.
Diffstat (limited to 'builtin.c')
-rw-r--r--builtin.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin.c b/builtin.c
index fa03222b..7523d6c9 100644
--- a/builtin.c
+++ b/builtin.c
@@ -1112,7 +1112,7 @@ out0:
memset(& state, 0, sizeof(state));
count = mbrlen(cp, arg->stlen, & state);
- if (count > 0) {
+ if (count != (size_t) -1 && count != (size_t) -2 && count > 0) {
prec = count;
/* may need to increase fw so that padding happens, see pr_tail code */
if (fw > 0)