eesh: Fix clang-analyzer complaints

The -e and -ewait options haven't done anything a normal
non-interactive invocation does in ages.

Just ignore them and let the malloc'ing argument handling deal with it.
This commit is contained in:
Kim Woelders 2020-01-25 16:41:10 +01:00
parent b6f500f3bc
commit 72a86722a7
1 changed files with 5 additions and 6 deletions

View File

@ -95,6 +95,10 @@ main(int argc, char **argv)
mode = 0; mode = 0;
display_name = NULL; display_name = NULL;
command = NULL; command = NULL;
#ifdef __clang_analyzer__
/* Seems not to understand asm FD_ZERO() */
memset(&fd, 0, sizeof(fd));
#endif
for (i = 1; i < argc; i++) for (i = 1; i < argc; i++)
{ {
@ -105,16 +109,10 @@ main(int argc, char **argv)
if (!strcmp(argv[i], "-e")) if (!strcmp(argv[i], "-e"))
{ {
mode = -1; mode = -1;
if (i != (argc - 1))
{
command = argv[++i];
}
} }
else if (!strcmp(argv[i], "-ewait")) else if (!strcmp(argv[i], "-ewait"))
{ {
mode = 1; mode = 1;
if (i != (argc - 1))
command = argv[++i];
} }
else if (!strcmp(argv[i], "-display")) else if (!strcmp(argv[i], "-display"))
{ {
@ -241,6 +239,7 @@ main(int argc, char **argv)
done: done:
ClientDestroy(e); ClientDestroy(e);
ClientDestroy(me); ClientDestroy(me);
free(command);
return 0; return 0;
} }