Browse Source

Fix c dataflow example: data string is not null-terminated

tags/v0.2.4-rc
Philipp Oppermann 2 years ago
parent
commit
13726eed96
Failed to extract signature
1 changed files with 2 additions and 3 deletions
  1. +2
    -3
      examples/c-dataflow/sink.c

+ 2
- 3
examples/c-dataflow/sink.c View File

@@ -12,9 +12,8 @@ int main()
{ {
fprintf(stderr, "failed to init dora context\n"); fprintf(stderr, "failed to init dora context\n");
return -1; return -1;

printf("[c sink] dora context initialized\n");
} }
printf("[c sink] dora context initialized\n");


while (1) while (1)
{ {
@@ -39,7 +38,7 @@ int main()


printf("[c sink] received input `"); printf("[c sink] received input `");
fwrite(id, id_len, 1, stdout); fwrite(id, id_len, 1, stdout);
printf("` with data: %s\n", data);
printf("` with data: %.*s\n", (int)data_len, data);
} }
else if (ty == DoraEventType_InputClosed) else if (ty == DoraEventType_InputClosed)
{ {


Loading…
Cancel
Save