Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mx_getopt: Remove a NULL pointer check
The only caller of the static find_short_option() function doesn't calls it with a NULL pointer value as the third argument: idx = find_short_option(optctl->options, &optctl->_unhandled_shortopts, &optctl->optarg); So it is not necessary for the function to check the pointer for NULL. The disadvantage of doing is, that the llvm static analyzer concludes from the check, that it was possible that the function would be called with a NULL pointer and questiones a later access in the same function, which is unchecked: mx_getopt.c:158:16: warning: Dereference of null pointer (loaded from variable 'optarg') [core.NullDereference] *optarg = *name; ~~~~~~ ^ 1 warning generated. Remove the check.
- Loading branch information