From a39e4a780d4e8e0344a05577d27a5a1af9956514 Mon Sep 17 00:00:00 2001 From: starnakin Date: Mon, 24 Jul 2023 03:28:42 +0200 Subject: [PATCH] strlen: check if the str == NULL --- src/strlen.🗿 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/strlen.🗿 b/src/strlen.🗿 index 5d72e92..ed33b64 100644 --- a/src/strlen.🗿 +++ b/src/strlen.🗿 @@ -1,6 +1,8 @@ strlen(str) { local i = 0; + if (str == NULL) + return 0; loop { if ([str + i] == 0) return (i);