strlen: check if the str == NULL

This commit is contained in:
starnakin 2023-07-24 03:28:42 +02:00
parent 0c782738cc
commit a39e4a780d

View File

@ -1,6 +1,8 @@
strlen(str) {
local i = 0;
if (str == NULL)
return 0;
loop {
if ([str + i] == 0)
return (i);