diff options
| author | Eugene Syromyatnikov <evgsyr@gmail.com> | 2018-02-02 16:15:48 +0100 |
|---|---|---|
| committer | Dmitry V. Levin <ldv@altlinux.org> | 2018-03-01 01:00:24 +0000 |
| commit | f6f7b82d4b8520e6fcfb82787f74e373cc4a3bbd (patch) | |
| tree | 8170fdf55ff45c6c63ab5560ff7280d532671249 | |
| parent | 2b4c03fcdbc666d343ef9e4e5478d39f4654e9e9 (diff) | |
| download | strace-f6f7b82d4b8520e6fcfb82787f74e373cc4a3bbd.tar.gz | |
Do not go full octal if the next char is '8' or '9'
* util.c (string_quote): Change the upper limit for the next character
in unabbreviated octal printing from '9' to '7'.
* tests/print_quoted_string.c (print_quoted_memory): Likewise.
| -rw-r--r-- | tests/print_quoted_string.c | 2 | ||||
| -rw-r--r-- | util.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/tests/print_quoted_string.c b/tests/print_quoted_string.c index 4107e2560..14a1f0fb8 100644 --- a/tests/print_quoted_string.c +++ b/tests/print_quoted_string.c @@ -70,7 +70,7 @@ print_quoted_memory(const void *const instr, const size_t len) if (i < (len - 1) && str[i + 1] >= '0' && - str[i + 1] <= '9') { + str[i + 1] <= '7') { /* Print \octal */ putchar(c3); putchar(c2); @@ -559,7 +559,7 @@ string_quote(const char *instr, char *outstr, const unsigned int size, *s++ = '\\'; if (i + 1 < size && ustr[i + 1] >= '0' - && ustr[i + 1] <= '9' + && ustr[i + 1] <= '7' ) { /* Print \ooo */ *s++ = '0' + (c >> 6); |
