b45574f17387690614d3c6948322b7ce8a8f0aca markd Tue Mar 4 13:57:05 2014 -0800 fixed check for include escape in GFF3 files diff --git src/lib/gff3.c src/lib/gff3.c index 4e755d8..b35c4f7 100644 --- src/lib/gff3.c +++ src/lib/gff3.c @@ -184,31 +184,31 @@ struct gff3AnnRef *ref = gff3FileAlloc(g3a->file, sizeof(struct gff3AnnRef)); ref->ann = g3a; return ref; } static void raiseInvalidEscape(struct gff3Ann *g3a, char *str) /* raise an error about an invalid escape in a string */ { gff3AnnErr(g3a, "invalid GFF escape sequence in string: %s", str); } static char convertEscape(struct gff3Ann *g3a, char *esc, char *src) /* convert character at esc, which should start with a `%' and be a string * in the form `%09' */ { -if (!(isxdigit(esc[1]) && isxdigit(esc[1]))) +if (!(isxdigit(esc[1]) && isxdigit(esc[2]))) raiseInvalidEscape(g3a, src); char num[3], *end; strncpy(num, esc+1, 2); num[2] = '\0'; long val = strtol(num, &end, 16); if ((end == num) || (*end != '\0')) raiseInvalidEscape(g3a, src); return (char)val; } static void unescapeStr(struct gff3Ann *g3a, char *dest, char *src) /* remove URL-style escapes from a string. dest need only have enough * memory to hold src, as unescaping will not grow the string */ { char *s = src, *d = dest;