Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
byroot committed Oct 21, 2024
1 parent d4d9f7e commit 646f123
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ext/json/ext/parser/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ RBIMPL_ATTR_NORETURN()
#endif
static void raise_parse_error(const char *format, const char *start)
{
size_t len = strnlen(start, PARSE_ERROR_FRAGMENT_LEN);
size_t len = *start ? strnlen(start, PARSE_ERROR_FRAGMENT_LEN) : 0;
fprintf(stderr, "strnlen = %ld\n", len);
const char *ptr = start;
if (len == PARSE_ERROR_FRAGMENT_LEN) {
Expand Down
2 changes: 1 addition & 1 deletion ext/json/ext/parser/parser.rl
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ RBIMPL_ATTR_NORETURN()
#endif
static void raise_parse_error(const char *format, const char *start)
{
size_t len = strnlen(start, PARSE_ERROR_FRAGMENT_LEN);
size_t len = *start ? strnlen(start, PARSE_ERROR_FRAGMENT_LEN) : 0;
fprintf(stderr, "strnlen = %ld\n", len);
const char *ptr = start;
if (len == PARSE_ERROR_FRAGMENT_LEN) {
Expand Down

0 comments on commit 646f123

Please sign in to comment.