Skip to content

Commit

Permalink
Fix data type for the packet variable
Browse files Browse the repository at this point in the history
Use the type of "unsigned char" to avoid sign extension when printing the value of a packet.
  • Loading branch information
hwangcc23 committed Dec 23, 2015
1 parent 003b543 commit 89f38d9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ int decode_stream(struct stream *stream)
/* INSYNC -> DECODING */
stream->state++;
for (; cur < stream->buff_len; ) {
char c = stream->buff[cur];
unsigned char c = stream->buff[cur];

LOGD("Got a packet header 0x%02x at offset %d\n", c, cur);

Expand Down

0 comments on commit 89f38d9

Please sign in to comment.