Skip to content

Commit 2c84448

Browse files
committed
Fix RFLOG() to correctly log unprintable char >7Fh
When characters didn't seem printable, they get escaped inside < > and the raw hex is printed to the log, but the character was getting cast as a 32 bit integer, which made for some nasty long negative ints when the original byte was unicode UTF-8 and the high bit was set.
1 parent b7d9822 commit 2c84448

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

aprx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ void rflog(const char *portname, char direction, int discard, const char *tnc2bu
672672
//replace non printing TNC2 characters in log print
673673
for(p=tnc2buf;p<tnc2buf+tnc2len;p++){
674674
if(*p<0x20 || *p>0x7e)
675-
fprintf(fp,"<0x%02x>",*p);
675+
fprintf(fp,"<0x%02x>",(unsigned char)*p);
676676
else
677677
fputc(*p,fp);
678678
}

0 commit comments

Comments
 (0)