From 63b2d8769be4b1f4fd4a51885137d72afa62e9d7 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Tue, 1 Oct 1996 03:16:46 +0000 Subject: (noise_write, noise_len): Correctly calculate the length of a character printed using an octal escape. --- libps/write.c | 4 ++-- 1 file 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; -- cgit v1.2.3