Skip to content

Commit

Permalink
fix sstrlen NULL issue
Browse files Browse the repository at this point in the history
  • Loading branch information
sulincix committed Apr 9, 2024
1 parent 3b2ccf1 commit b789264
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ccode/string.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ int iseq(char* str1, char* str2){

size_t sstrlen(const char* str){
size_t ret = 0;
while(str[ret] && str[ret] != '\0'){
while(str && str[0] != '\0'){
str++;
ret++;
}
return ret;
Expand Down

0 comments on commit b789264

Please sign in to comment.