From df6ded7c947ca0cc96219cb67768fdaf75d67ff0 Mon Sep 17 00:00:00 2001 From: shdown Date: Thu, 16 Oct 2014 17:29:33 +0400 Subject: common: fix \x-style escaping This was rejecting correct escapes and accepting incorrect ones. --- common/common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'common/common.c') diff --git a/common/common.c b/common/common.c index a74205dd92..449c95be26 100644 --- a/common/common.c +++ b/common/common.c @@ -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); -- cgit v1.2.3