Skip to content

Commit

Permalink
Merge pull request #467 from FelixTing/issue-466
Browse files Browse the repository at this point in the history
fix: update edgex_data_to_b64 to ignore the last null character
  • Loading branch information
FelixTing authored Jul 16, 2023
2 parents 5083ed3 + 4504df9 commit e31ab6e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/c/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ static void edgex_bus_endpoint_free (void *p)
static char *edgex_data_to_b64 (const iot_data_t *src)
{
char *json = iot_data_to_json (src);
size_t sz = strlen (json) + 1;
size_t sz = strlen (json); // ignore the last null character, which causes an unmarshal error in core-data
size_t encsz = iot_b64_encodesize (sz);
char *result = malloc (encsz);
iot_b64_encode (json, sz, result, encsz);
Expand Down

0 comments on commit e31ab6e

Please sign in to comment.