summaryrefslogtreecommitdiff
path: root/src/emacs.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2021-07-12 00:00:20 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2021-07-12 00:12:20 -0700
commit2337869fbf8b967eb53ee57f978f3751987e43dc (patch)
tree4efade0869b4c3f1d23ba4e09bdfc19cc2f57778 /src/emacs.c
parentda2f772fe575b20bff51b49aa5ded2bf15a2c89d (diff)
downloademacs-2337869fbf8b967eb53ee57f978f3751987e43dc.tar.gz
emacs-2337869fbf8b967eb53ee57f978f3751987e43dc.tar.bz2
emacs-2337869fbf8b967eb53ee57f978f3751987e43dc.zip
Pacify gcc 11.1.1 -Wanalyzer-null-argument
* lib-src/etags.c (regexp): Omit member force_explicit_name, since it’s always true. All uses removed. This lets us remove calls to strlen (name) where GCC isn’t smart enough to deduce that name must be nonnull. * lib-src/movemail.c (main): Fix bug that could cause link (tempname, NULL) to be called. * src/emacs.c (argmatch): Break check into two ‘if’s, since GCC doesn’t seem to be smart enough to check the single ‘if’. * src/gtkutil.c (xg_update_menu_item): Fix bug where strcmp could be given a NULL arg. * src/xfont.c (xfont_list_family): Use nonnull value for dummy initial value.
Diffstat (limited to 'src/emacs.c')
-rw-r--r--src/emacs.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/emacs.c b/src/emacs.c
index b7982ece646..866e43fda94 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -670,7 +670,9 @@ argmatch (char **argv, int argc, const char *sstr, const char *lstr,
}
arglen = (valptr != NULL && (p = strchr (arg, '=')) != NULL
? p - arg : strlen (arg));
- if (lstr == 0 || arglen < minlen || strncmp (arg, lstr, arglen) != 0)
+ if (!lstr)
+ return 0;
+ if (arglen < minlen || strncmp (arg, lstr, arglen) != 0)
return 0;
else if (valptr == NULL)
{