mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-05-27 15:04:33 +00:00
Add null check in isempty function
This commit is contained in:
parent
daccdaeeae
commit
c76eb67883
@ -341,8 +341,12 @@ EXTERNC int isspace(int c)
|
|||||||
|
|
||||||
EXTERNC int isempty(char *str)
|
EXTERNC int isempty(char *str)
|
||||||
{
|
{
|
||||||
|
if (str == NULL)
|
||||||
|
return 1;
|
||||||
|
|
||||||
if (strlen(str) == 0)
|
if (strlen(str) == 0)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
while (*str != '\0')
|
while (*str != '\0')
|
||||||
{
|
{
|
||||||
if (!isspace(*str))
|
if (!isspace(*str))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user