Skip to content

Commit

Permalink
Fix dereferencing possible NULL
Browse files Browse the repository at this point in the history
Fixes src/str.c:65:9: warning: check of ‘text’ for NULL after already dereferencing it

Signed-off-by: Alexandr Pashchenko <[email protected]>
  • Loading branch information
appashchenko committed Aug 4, 2024
1 parent 41a5bac commit 5a87cd9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/str.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ bool str_to_num(const char* text, size_t len, ssize_t* value, int base)
char buffer[32];
const char* ptr;

if (!text) {
return false;
}

if (!*text) {
return false;
}
Expand Down

0 comments on commit 5a87cd9

Please sign in to comment.