Skip to content

Commit

Permalink
Fix: Use strlen for JSON message in LightDB example
Browse files Browse the repository at this point in the history
`sizeof` gives the wrong value and so the JSON will be mangled. Using `strlen` sends the whole string which makes this example work.
  • Loading branch information
TimTTP authored and szczys committed Oct 29, 2024
1 parent 71685bf commit 450606f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion website/docs/zephyr-training/05_golioth/lightdb_stream.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Excerpts from `main.c`:
"sensor",
GOLIOTH_CONTENT_TYPE_JSON,
sbuf,
sizeof(sbuf),
strlen(sbuf),
NULL,
NULL);
// highlight-end
Expand Down

0 comments on commit 450606f

Please sign in to comment.