- assert(buf[0]= *++p); assert(buf[1]= *++p); buf[2]= 0;
- v= strtoul(buf,&bep,16); assert(bep == buf+2);
- assert(!(v & ~0xff)); *q++= v; p++; continue;
+ p++;
+ if (!((buf[0]= *p++) && (buf[1]= *p++))) {
+ parseerrprint("quoted string ends inside \\x<hex> sequence");
+ return tokv_error;
+ }
+ buf[2]= 0;
+ v= strtoul(buf,&bep,16);
+ if (bep != buf+2) {
+ parseerrprint("invalid \\<hex> sequence \\x%s in quoted string",buf);
+ return tokv_error;
+ }
+ assert(!(v & ~0xff));
+ *q++= v;
+ continue;