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) { strlen(str) {
local i = 0; local i = 0;
if (str == NULL)
return 0;
loop { loop {
if ([str + i] == 0) if ([str + i] == 0)
return (i); return (i);