Skip to content

Commit d6d757f

Browse files
committed
Fix fprintzid
1 parent 4e81de9 commit d6d757f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

examples/freertos_plus_tcp/z_scout.c

+5-4
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@
2020

2121
#include "FreeRTOS.h"
2222

23-
void fprintzid(FILE *stream, z_bytes_t zid) {
24-
if (zid.start == NULL) {
23+
void fprintzid(FILE *stream, z_id_t zid) {
24+
unsigned int zidlen = _z_id_len(zid);
25+
if (zidlen == 0) {
2526
fprintf(stream, "None");
2627
} else {
2728
fprintf(stream, "Some(");
28-
for (unsigned int i = 0; i < zid.len; i++) {
29-
fprintf(stream, "%02X", (int)zid.start[i]);
29+
for (unsigned int i = 0; i < zidlen; i++) {
30+
fprintf(stream, "%02X", (int)zid.id[i]);
3031
}
3132
fprintf(stream, ")");
3233
}

0 commit comments

Comments
 (0)