follow completely @wasabiz's code
This commit is contained in:
parent
c440629dbf
commit
a50d3da569
|
@ -363,6 +363,7 @@ read_pipe(pic_state *pic, struct pic_port *port, char c)
|
||||||
pic_sym sym;
|
pic_sym sym;
|
||||||
/* Currently supports only ascii chars */
|
/* Currently supports only ascii chars */
|
||||||
char HEX_BUF[3];
|
char HEX_BUF[3];
|
||||||
|
size_t i = 0;
|
||||||
|
|
||||||
size = 256;
|
size = 256;
|
||||||
buf = pic_alloc(pic, size);
|
buf = pic_alloc(pic, size);
|
||||||
|
@ -376,7 +377,8 @@ read_pipe(pic_state *pic, struct pic_port *port, char c)
|
||||||
case 'n': c = '\n'; break;
|
case 'n': c = '\n'; break;
|
||||||
case 'r': c = '\r'; break;
|
case 'r': c = '\r'; break;
|
||||||
case 'x':
|
case 'x':
|
||||||
for(size_t i = 0; (HEX_BUF[i] = next(port)) != ';'; i++) {
|
i = 0;
|
||||||
|
while ((HEX_BUF[i++] = next(port)) != ';') {
|
||||||
if (i >= sizeof HEX_BUF)
|
if (i >= sizeof HEX_BUF)
|
||||||
read_error(pic, "expected ';'");
|
read_error(pic, "expected ';'");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue