mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-12-22 10:30:13 +00:00
Trap CR in framed debug string
This commit is contained in:
parent
dff77aea61
commit
6852c0cb03
@ -536,7 +536,14 @@ read_more:
|
|||||||
if (timestamp) {
|
if (timestamp) {
|
||||||
if (inpktbuf[0]!='0' || inpktbuf[1]!=0 || inpktbuf[2]!=0 || inpktbuf[3]!=0) stamptime();
|
if (inpktbuf[0]!='0' || inpktbuf[1]!=0 || inpktbuf[2]!=0 || inpktbuf[3]!=0) stamptime();
|
||||||
}
|
}
|
||||||
fwrite(inpktbuf, inbufptr, 1, stderr);
|
/* This could be a proper debug string starting with CR just a print to stdout */
|
||||||
|
/* Trap the CR which would cause overwriting of the timestamp */
|
||||||
|
//{int i;for (i=0;i<inbufptr;i++) fprintf(stderr,"%2x ",inpktbuf[i]);}
|
||||||
|
if(inpktbuf[0] == DEBUG_LINE_MARKER) {
|
||||||
|
fwrite(inpktbuf + 1, inbufptr - 1, 1, stderr);
|
||||||
|
} else {
|
||||||
|
fwrite(inpktbuf, inbufptr, 1, stderr);
|
||||||
|
}
|
||||||
inbufptr=0;
|
inbufptr=0;
|
||||||
} else if (c == 0 || c == '\t' || c == '\r') {
|
} else if (c == 0 || c == '\t' || c == '\r') {
|
||||||
} else if(c < ' ' || '~' < c) {
|
} else if(c < ' ' || '~' < c) {
|
||||||
|
Loading…
Reference in New Issue
Block a user