diff options
-rw-r--r-- | libbb/process_escape_sequence.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libbb/process_escape_sequence.c b/libbb/process_escape_sequence.c index 7b1d97f9c..346ecfa1e 100644 --- a/libbb/process_escape_sequence.c +++ b/libbb/process_escape_sequence.c | |||
@@ -75,8 +75,8 @@ char FAST_FUNC bb_process_escape_sequence(const char **ptr) | |||
75 | * Manpages tend to support coreutils way. | 75 | * Manpages tend to support coreutils way. |
76 | * Update: coreutils added support for \e on 28 Oct 2009. */ | 76 | * Update: coreutils added support for \e on 28 Oct 2009. */ |
77 | static const char charmap[] ALIGN1 = { | 77 | static const char charmap[] ALIGN1 = { |
78 | 'a', 'b', 'e', 'f', 'n', 'r', 't', 'v', '\\', | 78 | 'a', 'b', 'e', 'f', 'n', 'r', 't', 'v', '\\', '\0', |
79 | '\a', '\b', 27, '\f', '\n', '\r', '\t', '\v', '\\', | 79 | '\a', '\b', 27, '\f', '\n', '\r', '\t', '\v', '\\', '\\', |
80 | }; | 80 | }; |
81 | const char *p = charmap; | 81 | const char *p = charmap; |
82 | do { | 82 | do { |
@@ -84,8 +84,8 @@ char FAST_FUNC bb_process_escape_sequence(const char **ptr) | |||
84 | q++; | 84 | q++; |
85 | break; | 85 | break; |
86 | } | 86 | } |
87 | } while (*++p != '\\'); | 87 | } while (*++p != '\0'); |
88 | /* p points to found escape char or '\', | 88 | /* p points to found escape char or NUL, |
89 | * advance it and find what it translates to. | 89 | * advance it and find what it translates to. |
90 | * Note that \NUL and unrecognized sequence \z return '\' | 90 | * Note that \NUL and unrecognized sequence \z return '\' |
91 | * and leave ptr pointing to NUL or z. */ | 91 | * and leave ptr pointing to NUL or z. */ |