1
0
mirror of https://github.com/bgp/bgpq4.git synced 2024-05-11 05:55:05 +00:00

shall not hang at unsupported escape characters.

This commit is contained in:
Alexandre Snarskii
2015-07-13 20:22:31 +03:00
parent dabcb674f5
commit 409baea7c7

View File

@@ -7,6 +7,7 @@
#include <netinet/in.h>
#include <arpa/inet.h>
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -245,10 +246,18 @@ main(int argc, char* argv[])
*d='\r';
d++;
c+=2;
} else if(*(c+1)=='t') {
*d='\t';
d++;
c+=2;
} else if(*(c+1)=='\\') {
*d='\\';
d++;
c+=2;
} else {
sx_report(SX_FATAL, "Unsupported escape \%c (0x%2.2x) "
"in '%s'\n", isprint(*c)?*c:20, *c, optarg);
exit(1);
};
} else {
if(c!=d) {