Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions programs/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ int UTIL_countPhysicalCores(void)
if (fgets(buff, BUF_SIZE, cpuinfo) != NULL) {
if (strncmp(buff, "siblings", 8) == 0) {
const char* const sep = strchr(buff, ':');
if (*sep == '\0') {
if (sep == NULL || *sep == '\0') {
/* formatting was broken? */
goto failed;
}
Expand All @@ -503,7 +503,7 @@ int UTIL_countPhysicalCores(void)
}
if (strncmp(buff, "cpu cores", 9) == 0) {
const char* const sep = strchr(buff, ':');
if (*sep == '\0') {
if (sep == NULL || *sep == '\0') {
/* formatting was broken? */
goto failed;
}
Expand Down