Skip to content

Commit 25fa058

Browse files
author
Bulat Shakirzyanov
committed
return end of string when length is zero
1 parent a5fff20 commit 25fa058

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ext/util/types.c

+4
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,10 @@ next_token(const char* str, size_t len,
259259
{
260260
enum token_type type;
261261

262+
if (len == 0) {
263+
return TOKEN_END;
264+
}
265+
262266
unsigned int i = 0;
263267
char c = str[i];
264268

0 commit comments

Comments
 (0)