diff options
author | Rob Landley <rob@landley.net> | 2020-05-21 01:25:02 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2020-05-21 01:25:02 -0500 |
commit | 310eefe2956725ab1ae913a2eccf3f885e321c7f (patch) | |
tree | d6859b57cc8218ee2ade7b22531a6cd5e8ae078b | |
parent | cedf9d9525f9d0203a56358f2ff45384f2519f4d (diff) | |
download | toybox-310eefe2956725ab1ae913a2eccf3f885e321c7f.tar.gz |
David Legault reported that unescape2() doesn't handle \0 right
because scanf("0%o") needs a 0 _and_ one or more digits. So add it to
the end of the \n translation list (where it returns the null terminator).
-rw-r--r-- | lib/lib.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -453,7 +453,7 @@ int unescape2(char **c, int echo) } } - if (-1 == (idx = stridx("\\abeEfnrtv'\"?", **c))) return '\\'; + if (-1 == (idx = stridx("\\abeEfnrtv'\"?0", **c))) return '\\'; ++*c; return "\\\a\b\033\033\f\n\r\t\v'\"?"[idx]; |