Add clang analyzer CI job

This commit is contained in:
Christian Göttsche
2020-09-21 15:06:19 +02:00
committed by cgzones
parent d69585b82a
commit b82a13c6ba
3 changed files with 26 additions and 3 deletions

2
htop.c
View File

@ -107,6 +107,7 @@ static CommandLineSettings parseArguments(int argc, char** argv) {
printVersionFlag();
exit(0);
case 's':
assert(optarg); /* please clang analyzer, cause optarg can be NULL in the 'u' case */
if (strcmp(optarg, "help") == 0) {
for (int j = 1; j < Platform_numberOfFields; j++) {
const char* name = Process_fields[j].name;
@ -158,6 +159,7 @@ static CommandLineSettings parseArguments(int argc, char** argv) {
flags.treeView = true;
break;
case 'p': {
assert(optarg); /* please clang analyzer, cause optarg can be NULL in the 'u' case */
char* argCopy = xStrdup(optarg);
char* saveptr;
char* pid = strtok_r(argCopy, ",", &saveptr);