aboutsummaryrefslogtreecommitdiffstats
path: root/profile.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2015-04-09 18:04:18 +0300
committerArnold D. Robbins <arnold@skeeve.com>2015-04-09 18:04:18 +0300
commit24ddf2742b0034089bce38e5f4ebd99b93c6e161 (patch)
treef1bebfcf20d78673b656122b0258c5054a999562 /profile.c
parent9091a155190093c3d2dbbed4bd29b0feec50c8ce (diff)
downloadegawk-24ddf2742b0034089bce38e5f4ebd99b93c6e161.tar.gz
egawk-24ddf2742b0034089bce38e5f4ebd99b93c6e161.tar.bz2
egawk-24ddf2742b0034089bce38e5f4ebd99b93c6e161.zip
Further fixes from Andrew Schorr.
Diffstat (limited to 'profile.c')
-rw-r--r--profile.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/profile.c b/profile.c
index d6d49098..32dfca09 100644
--- a/profile.c
+++ b/profile.c
@@ -1371,10 +1371,9 @@ pp_string(const char *in_str, size_t len, int delim)
*obufout++ = '\\';
*obufout++ = delim;
} else if (*str == '\0') {
- chksize(4);
-
*obufout++ = '\\';
*obufout++ = '0';
+ chksize(2); /* need 2 more chars for this case */
*obufout++ = '0';
*obufout++ = '0';
} else if ((cp = strchr(escapes, *str)) != NULL) {
@@ -1384,7 +1383,7 @@ pp_string(const char *in_str, size_t len, int delim)
/* NB: Deliberate use of lower-case versions. */
} else if (isascii(*str) && isprint(*str)) {
*obufout++ = *str;
- ofre += 1;
+ ofre += 1; /* used 1 less than expected */
} else {
size_t len;