summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1996-10-01 03:16:46 +0000
committerMiles Bader <miles@gnu.org>1996-10-01 03:16:46 +0000
commit63b2d8769be4b1f4fd4a51885137d72afa62e9d7 (patch)
tree94cee06e598e1bd6839871df5a9431b4e6fbdd57
parent26086b85523d9caf1baaec36d573668d5f8ef346 (diff)
(noise_write, noise_len):
Correctly calculate the length of a character printed using an octal escape.
-rw-r--r--libps/write.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libps/write.c b/libps/write.c
index 725ea288..83be42ab 100644
--- a/libps/write.c
+++ b/libps/write.c
@@ -68,7 +68,7 @@ noise_write (const unsigned char *t, ssize_t max, FILE *s)
if (flush (&ok, t, s))
return errno;
- len += (is_cntl ? 2 : 3);
+ len += (is_cntl ? 2 : 4);
if (max >= 0 && len > max)
break;
@@ -96,7 +96,7 @@ noise_len (const char *t, ssize_t max)
len++;
else
{
- size_t rep_len = iscntl (ch) ? 2 : 3;
+ size_t rep_len = iscntl (ch) ? 2 : 4;
if (max >= 0 && rep_len + len > max)
break;
len += rep_len;