Skip to content

Commit

Permalink
pack: deprecate flb_pack_json_valid() (#691)
Browse files Browse the repository at this point in the history
JSMN in strict mode cannot be used to validate a JSON string without
filing the tokens, it behavior is unexpected, more details about this
in the following jsmn pull request:

    zserge/jsmn#119 (comment)

this patch remove the flb_pack_json_valid() function.

Signed-off-by: Eduardo Silva <[email protected]>
  • Loading branch information
edsiper committed Aug 6, 2018
1 parent ea65b5b commit d137d52
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions src/flb_pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,20 +211,6 @@ int flb_pack_json(char *js, size_t len, char **buffer, size_t *size)
return ret;
}

int flb_pack_json_valid(char *json, size_t len)
{
int ret;
jsmn_parser parser;

jsmn_init(&parser);
ret = jsmn_parse(&parser, json, len, NULL, 0);
if (ret <= 0) {
return -1;
}

return 0;
}

/* Initialize a JSON packer state */
int flb_pack_state_init(struct flb_pack_state *s)
{
Expand Down

0 comments on commit d137d52

Please sign in to comment.