common: fix \x-style escaping

This was rejecting correct escapes and accepting incorrect ones.
This commit is contained in:
shdown 2014-10-16 17:29:33 +04:00 committed by wm4
parent 040c5a9f68
commit df6ded7c94
1 changed files with 1 additions and 1 deletions

View File

@ -171,7 +171,7 @@ static bool mp_parse_escape(void *talloc_ctx, bstr *dst, bstr *code)
if (code->start[0] == 'x' && code->len >= 3) {
bstr num = bstr_splice(*code, 1, 3);
char c = bstrtoll(num, &num, 16);
if (!num.len)
if (num.len)
return false;
bstr_xappend(talloc_ctx, dst, (bstr){&c, 1});
*code = bstr_cut(*code, 3);