From 310eefe2956725ab1ae913a2eccf3f885e321c7f Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Thu, 21 May 2020 01:25:02 -0500 Subject: 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). --- lib/lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/lib.c b/lib/lib.c index 71ce1fac..930f66e4 100644 --- a/lib/lib.c +++ b/lib/lib.c @@ -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]; -- cgit v1.2.3