From c76eb67883366ac1388b811eb8b2224b405fcd13 Mon Sep 17 00:00:00 2001 From: EnderIce2 Date: Wed, 3 Apr 2024 01:40:38 +0300 Subject: [PATCH] Add null check in isempty function --- library/convert.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/library/convert.cpp b/library/convert.cpp index afaf1d5c..0750d37a 100644 --- a/library/convert.cpp +++ b/library/convert.cpp @@ -341,8 +341,12 @@ EXTERNC int isspace(int c) EXTERNC int isempty(char *str) { + if (str == NULL) + return 1; + if (strlen(str) == 0) return 1; + while (*str != '\0') { if (!isspace(*str))