strlen: check if the str == NULL
This commit is contained in:
parent
0c782738cc
commit
a39e4a780d
@ -1,6 +1,8 @@
|
||||
strlen(str) {
|
||||
local i = 0;
|
||||
|
||||
if (str == NULL)
|
||||
return 0;
|
||||
loop {
|
||||
if ([str + i] == 0)
|
||||
return (i);
|
||||
|
Loading…
Reference in New Issue
Block a user