diff --git a/usr.bin/seq/seq.c b/usr.bin/seq/seq.c index fc5a15ccd..bb00a339b 100644 --- a/usr.bin/seq/seq.c +++ b/usr.bin/seq/seq.c @@ -350,8 +350,13 @@ unescape(char *orig) *orig = c; --cp; continue; - case 'x': /* hexidecimal number */ + case 'x': /* hexadecimal number */ cp++; /* skip 'x' */ + if (!isxdigit((unsigned char)*cp)) { + --cp; + /* keep the backslash, treat 'x' literally */ + continue; + } for (i = 0, c = 0; isxdigit((unsigned char)*cp) && i < 2; i++, cp++) {