Skip to content
This repository has been archived by the owner on Nov 20, 2024. It is now read-only.

Commit

Permalink
Add null check in isempty function
Browse files Browse the repository at this point in the history
  • Loading branch information
EnderIce2 committed Apr 2, 2024
1 parent daccdae commit c76eb67
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions library/convert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit c76eb67

Please sign in to comment.