diff --git a/parse.yacc b/parse.yacc index 77bab2976..731274870 100644 --- a/parse.yacc +++ b/parse.yacc @@ -511,7 +511,7 @@ cmndalias : ALIAS { in_alias = TRUE; /* Allocate space for ga_list if necesary. */ expand_ga_list(); - if (!(ga_list[ga_list_len-1].alias = strdup($1))){ + if (!(ga_list[ga_list_len-1].alias = (char *) strdup($1))){ (void) fprintf(stderr, "%s: cannot allocate memory!\n", Argv[0]); exit(1); @@ -544,7 +544,7 @@ runasalias : ALIAS { in_alias = TRUE; /* Allocate space for ga_list if necesary. */ expand_ga_list(); - if (!(ga_list[ga_list_len-1].alias = strdup($1))){ + if (!(ga_list[ga_list_len-1].alias = (char *) strdup($1))){ (void) fprintf(stderr, "%s: cannot allocate memory!\n", Argv[0]); exit(1); diff --git a/sudo.c b/sudo.c index 898f505ac..260c35abd 100644 --- a/sudo.c +++ b/sudo.c @@ -560,7 +560,7 @@ static void load_globals(sudo_mode) */ if ((p = strchr(host, '.'))) { *p = '\0'; - if ((shost = strdup(host)) == NULL) { + if ((shost = (char *) strdup(host)) == NULL) { (void) fprintf(stderr, "%s: cannot allocate memory!\n", Argv[0]); exit(1); } diff --git a/testsudoers.c b/testsudoers.c index af26c6253..d1b4c2ea3 100644 --- a/testsudoers.c +++ b/testsudoers.c @@ -293,7 +293,7 @@ int main(argc, argv) if ((p = strchr(host, '.'))) { *p = '\0'; - if ((shost = strdup(host)) == NULL) { + if ((shost = (char *) strdup(host)) == NULL) { (void) fprintf(stderr, "%s: cannot allocate memory!\n", Argv[0]); exit(1); }