diff options
author | Elliott Hughes <enh@google.com> | 2020-08-03 13:38:46 -0700 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2020-08-04 03:04:10 -0500 |
commit | 3ba988c453056cbdda2bc26f1b9cbc3b4697acd0 (patch) | |
tree | 9b54a59ab4ea475cae603d798c610166281270f2 /lib | |
parent | ab8f7729c0f7609a33e003ca145ca39f254ccbc4 (diff) | |
download | toybox-3ba988c453056cbdda2bc26f1b9cbc3b4697acd0.tar.gz |
echo: fix trailing \0.
This is a follow-on from 310eefe, addressing the case where sscanf fails
and returns -1.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/lib.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -445,7 +445,7 @@ int unescape2(char **c, int echo) if (**c == 'c') return 31&*(++*c); for (i = 0; i<4; i++) { if (sscanf(*c, (char *[]){"0%3o%n"+!echo, "x%2x%n", "u%4x%n", "U%6x%n"}[i], - &idx, &off)) + &idx, &off) > 0) { *c += off; |