]> granicus.if.org Git - sudo/commitdiff
add cast for strdup in places it does not have it
authorTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 11 Feb 1999 06:41:32 +0000 (06:41 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 11 Feb 1999 06:41:32 +0000 (06:41 +0000)
parse.yacc
sudo.c
testsudoers.c

index 77bab2976b454d84d43a18102c293bc78e20c95b..731274870fe43fc45ce319884fef76ab6734ce66 100644 (file)
@@ -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 898f505ace49bce3d793fb6766989e9949cdc550..260c35abdad19652261af7deddcec8ae7dba0696 100644 (file)
--- 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);
        }
index af26c62533df6a3a706e78210d29a51c0c531792..d1b4c2ea3330732beab1078e1d44017801a03bf1 100644 (file)
@@ -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);
        }