remove redundant brace following review
This commit is contained in:
parent
b373ec433b
commit
2c1209ba63
13
src/read.c
13
src/read.c
|
@ -361,6 +361,8 @@ read_pipe(pic_state *pic, struct pic_port *port, char c)
|
||||||
char *buf;
|
char *buf;
|
||||||
size_t size, cnt;
|
size_t size, cnt;
|
||||||
pic_sym sym;
|
pic_sym sym;
|
||||||
|
/* Currently supports only ascii chars */
|
||||||
|
char HEX_BUF[3];
|
||||||
|
|
||||||
size = 256;
|
size = 256;
|
||||||
buf = pic_alloc(pic, size);
|
buf = pic_alloc(pic, size);
|
||||||
|
@ -373,16 +375,11 @@ read_pipe(pic_state *pic, struct pic_port *port, char c)
|
||||||
case 't': c = '\t'; break;
|
case 't': c = '\t'; break;
|
||||||
case 'n': c = '\n'; break;
|
case 'n': c = '\n'; break;
|
||||||
case 'r': c = '\r'; break;
|
case 'r': c = '\r'; break;
|
||||||
case 'x':{
|
case 'x':
|
||||||
/* Currently supports only ascii chars */
|
for(size_t i = 0; (HEX_BUF[i++] = (next(port))) != ';' && i < sizeof HEX_BUF;);
|
||||||
size_t s = 3; /* 2 bytes of hex + 1 byte of terminator(';')*/
|
c = (char)strtol(HEX_BUF, NULL, 16);
|
||||||
char hex[s];
|
|
||||||
size_t i = 0;
|
|
||||||
while((hex[i++] = (next(port))) != ';' && i < s);
|
|
||||||
c = (char)strtol(hex, NULL, 16);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
buf[cnt++] = c;
|
buf[cnt++] = c;
|
||||||
if (cnt >= size) {
|
if (cnt >= size) {
|
||||||
|
|
Loading…
Reference in New Issue