Ignore:
Timestamp:
Aug 29, 2009, 3:22:10 AM (15 years ago)
Author:
Bruno Cornec
Message:
  • Some more fgets => mr_getline transformations
  • XWIN define is gone
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.10/mondo/src/mondorestore/mondo-rstr-newt.c

    r2356 r2357  
    533533
    534534    system("grep Pers /proc/mdstat > /tmp/raid-personalities.txt 2> /dev/null");
    535     mr_asprintf(personalities, "%s", last_line_of_file("/tmp/raid-personalities.txt"));
     535    personalities = last_line_of_file("/tmp/raid-personalities.txt");
    536536    mr_asprintf(prompt, "Please enter the RAID level you want. %s", personalities);
    537537    mr_free(personalities);
     
    22912291    if (does_file_exist("/tmp/NFS-SERVER-PATH")) {
    22922292        mr_free(idev);
    2293         mr_asprintf(idev, "%s", last_line_of_file("/tmp/NFS-SERVER-MOUNT"));
     2293        idev = last_line_of_file("/tmp/NFS-SERVER-MOUNT");
    22942294        mr_asprintf(isodir_format, "nfs");
    22952295        mr_free(isodir_path);
    2296         mr_asprintf(isodir_path, "%s", last_line_of_file("/tmp/NFS-SERVER-PATH"));
     2296        isodir_path = last_line_of_file("/tmp/NFS-SERVER-PATH");
    22972297    }
    22982298
     
    28612861  /** char *************************************************************/
    28622862    char output = '\0';
    2863     char tmp[MAX_STR_LEN];
     2863    char *tmp = NULL;
    28642864
    28652865  /** newt *************************************************************/
     
    28732873
    28742874    if (g_text_mode) {
    2875         for (output = 'z'; !strchr("AICE", output); output = tmp[0]) {
    2876             printf
    2877                 ("Which mode - (A)utomatic, (I)nteractive, \n(C)ompare only, or (E)xit to shell?\n--> ");
    2878             fgets(tmp, MAX_STR_LEN - 1, stdin);
     2875        while (!strchr("AICE", output)) {
     2876            printf("Which mode - (A)utomatic, (I)nteractive, \n(C)ompare only, or (E)xit to shell?\n--> ");
     2877            mr_getline(tmp, stdin);
     2878            output = tmp[0];
     2879            free(tmp);
    28792880        }
    28802881        return (output);
    28812882    }
    28822883
    2883     newtPushHelpLine
    2884         ("   Do you want to 'nuke' your system, restore interactively, or just compare?");
     2884    newtPushHelpLine("   Do you want to 'nuke' your system, restore interactively, or just compare?");
    28852885    newtOpenWindow(24, 3, 32, 17, "How should I restore?");
    28862886    b1 = newtButton(7, 1, "Automatically");
Note: See TracChangeset for help on using the changeset viewer.