Merge pull request #1980 from RincewindsHat/compiler_warning_part_7

Compiler warning part 7
This commit is contained in:
Lorenz Kästle 2023-12-30 20:39:31 +01:00 committed by GitHub
commit 7dfddfbc88
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 5 additions and 10 deletions

View file

@ -497,7 +497,7 @@ int send_dhcp_discover(int sock){
memcpy(&discover_packet.options[opts],&requested_address,sizeof(requested_address));
opts += sizeof(requested_address);
}
discover_packet.options[opts++]=DHCP_OPTION_END;
discover_packet.options[opts++]= (char)DHCP_OPTION_END;
/* unicast fields */
if(unicast)

View file

@ -472,9 +472,8 @@ bool process_arguments (int argc, char **argv)
http_method = strdup (optarg);
char *tmp;
if ((tmp = strstr(http_method, ":")) != NULL) {
tmp[0] = '\0';
http_method = http_method;
http_method_proxy = ++tmp;
tmp[0] = '\0'; // set the ":" in the middle to 0
http_method_proxy = ++tmp; // this points to the second part
}
break;
case 'd': /* string or substring */

View file

@ -691,7 +691,6 @@ process_arguments (int argc, char **argv)
{
char *ptr;
int c = 1;
int ii = 0;
size_t j = 0, jj = 0;
int option = 0;
@ -848,7 +847,6 @@ process_arguments (int argc, char **argv)
numoids = j;
if (c == 'E' || c == 'e') {
jj++;
ii++;
while (j+1 >= eval_size) {
eval_size += OID_COUNT_STEP;
eval_method = realloc(eval_method, eval_size * sizeof(*eval_method));
@ -875,7 +873,6 @@ process_arguments (int argc, char **argv)
memset(eval_method + eval_size - OID_COUNT_STEP, 0, 8);
}
eval_method[jj++] = CRIT_STRING;
ii++;
break;
case 'R': /* regex */
cflags = REG_ICASE;
@ -896,7 +893,6 @@ process_arguments (int argc, char **argv)
memset(eval_method + eval_size - OID_COUNT_STEP, 0, 8);
}
eval_method[jj++] = CRIT_REGEX;
ii++;
break;
/* Format */

View file

@ -105,7 +105,7 @@ spopen (const char *cmdstring)
#endif
env[0] = strdup("LC_ALL=C");
env[1] = '\0';
env[1] = NULL;
/* if no command was passed, return with no error */
if (cmdstring == NULL)

View file

@ -115,7 +115,7 @@ np_runcmd_open(const char *cmdstring, int *pfd, int *pfderr)
if(!np_pids) NP_RUNCMD_INIT;
env[0] = strdup("LC_ALL=C");
env[1] = '\0';
env[1] = NULL;
/* make copy of command string so strtok() doesn't silently modify it */
/* (the calling program may want to access it later) */