mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-13 01:13:02 +01:00
simplify string_is_empty
This commit is contained in:
parent
0396ce6456
commit
7a0951afc6
@ -50,14 +50,10 @@ void print_time(WINDOW *window)
|
||||
wattroff(window, COLOR_PAIR(CYAN));
|
||||
}
|
||||
|
||||
/* check that the string has one non-space character */
|
||||
/* Returns 1 if the string is empty, 0 otherwise */
|
||||
int string_is_empty(char *string)
|
||||
{
|
||||
int rc = 0;
|
||||
char *copy = strdup(string);
|
||||
rc = ((strtok(copy, " ") == NULL) ? 1 : 0);
|
||||
free(copy);
|
||||
return rc;
|
||||
return strlen(string) <= 0;
|
||||
}
|
||||
|
||||
/* convert wide characters to null terminated string */
|
||||
|
Loading…
Reference in New Issue
Block a user