Ignore:
Timestamp:
Nov 10, 2012, 5:05:37 AM (11 years ago)
Author:
Bruno Cornec
Message:

r5035@localhost: bruno | 2012-11-09 03:17:01 +0100

  • Fix a compilation error and most compilation warnings
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.0/mondo/src/common/newt-specific.c

    r2982 r3060  
    123123        /*@ buffers ********************************************************** */
    124124        int i;
     125        char *p;
    125126
    126127         assert_string_is_neither_NULL_nor_zerolength(prompt);
     
    132133
    133134            while (1) {
    134                 system("sync");
     135                paranoid_system("sync");
    135136                printf
    136137                    ("---promptdialogYN---1--- %s\n---promptdialogYN---Q--- [yes] [no] ---\n--> ",
    137138                     prompt);
    138                 (void) fgets(tmp, MAX_NEWT_COMMENT_LEN, stdin);
     139                p= fgets(tmp, MAX_NEWT_COMMENT_LEN, stdin);
     140                if (!p) {
     141                    //FIXME
     142                }
    139143                if (tmp[strlen(tmp) - 1] == '\n')
    140144                    tmp[strlen(tmp) - 1] = '\0';
     
    151155                    return (FALSE);
    152156                } else {
    153                     system("sync");
     157                    paranoid_system("sync");
    154158                    printf
    155159                        ("Please enter either YES or NO (or yes or no, or y or n, or...)\n");
     
    172176        /*@ buffer *********************************************************** */
    173177        char *tmp;
     178        char *p;
    174179        int i;
    175180
     
    177182        assert_string_is_neither_NULL_nor_zerolength(prompt);
    178183        if (g_text_mode) {
    179             system("sync");
     184            paranoid_system("sync");
    180185            printf
    181186                ("---promptdialogOKC---1--- %s\n---promptdialogOKC---Q--- [OK] [Cancel] ---\n--> ",
    182187                 prompt);
    183             (void) fgets(tmp, MAX_NEWT_COMMENT_LEN, stdin);
     188            p = fgets(tmp, MAX_NEWT_COMMENT_LEN, stdin);
     189            if (!p) {
     190                // FIXME
     191            }
    184192            if (tmp[strlen(tmp) - 1] == '\n')
    185193                tmp[strlen(tmp) - 1] = '\0';
     
    347355        */
    348356
    349         chdir("/");
     357        if (chdir("/")) {
     358            // FIXME
     359        }
    350360        if (g_selfmounted_isodir) {
    351361            sprintf(command, "umount -d %s", g_selfmounted_isodir);
     
    406416
    407417        /*  Before removing dir, make sure we're out of them */
    408         chdir("/tmp");
     418        if (chdir("/tmp")) {
     419            // FIXME
     420        }
    409421        run_program_and_log_output("umount -d " MNT_CDROM, FALSE);
    410422        if (g_selfmounted_isodir) {
     
    432444                log_msg(8,"erasing tempdir %s",bkpinfo->tmpdir);
    433445                mr_asprintf(&command, "rm -Rf %s", bkpinfo->tmpdir);
    434                 system(command);
     446                paranoid_system(command);
    435447                mr_free(command);
    436448            }
     
    441453                log_msg(8,"erasing scratchdir %s",bkpinfo->scratchdir);
    442454                mr_asprintf(&command, "rm -Rf %s", bkpinfo->scratchdir);
    443                 system(command);
     455                paranoid_system(command);
    444456                mr_free(command);
    445457            }
     
    475487        char *command = NULL;
    476488        char *tmp = NULL;
     489        char *p = NULL;
    477490
    478491        /*@ pointers ********************************************************* */
     
    502515                for (err_log_lines[i][0] = '\0';
    503516                     strlen(err_log_lines[i]) < 2 && !feof(fin);) {
    504                     (void) fgets(err_log_lines[i], MAX_NEWT_COMMENT_LEN,
    505                                  fin);
     517                    p = fgets(err_log_lines[i], MAX_NEWT_COMMENT_LEN, fin);
     518                    if (!p) {
     519                        // FIXME
     520                    }
    506521                    /* Commented to make valgrind happy and avoid crash
    507522                    strip_spaces(err_log_lines[i]);
     
    774789        /*@ buffers ********************************************************** */
    775790        char *blurb;
     791        char *p;
    776792        char *original_contents;
    777793
     
    786802                ("---promptstring---1--- %s\n---promptstring---2--- %s\n---promptstring---Q---\n-->  ",
    787803                 title, b);
    788             (void) fgets(output, maxsize, stdin);
     804            p = fgets(output, maxsize, stdin);
     805            if (!p) {
     806                // FIXME
     807            }
    789808            if (output[strlen(output) - 1] == '\n')
    790809                output[strlen(output) - 1] = '\0';
     
    843862        /*@ buffers *********************************************************** */
    844863        char *prompt;
     864        char *q;
    845865
    846866        /*@ newt ************************************************************** */
     
    865885                                          || strcmp(prompt, button2));) {
    866886                printf("--> ");
    867                 (void) fgets(prompt, MAX_NEWT_COMMENT_LEN, stdin);
     887                q = fgets(prompt, MAX_NEWT_COMMENT_LEN, stdin);
     888                if (!q) {
     889                    // FIXME
     890                }
    868891            }
    869892            if (!strcmp(prompt, button1)) {
     
    12761299"netfs", "iso", NULL };
    12771300        char *outstr;
     1301        char *p;
    12781302        t_bkptype backup_type;
    12791303        int i;
     
    13011325                }
    13021326                printf(")\n--> ");
    1303                 (void) fgets(outstr, MAX_NEWT_COMMENT_LEN, stdin);
     1327                p = fgets(outstr, MAX_NEWT_COMMENT_LEN, stdin);
     1328                if (!p) {
     1329                    // FIXME
     1330                }
    13041331                strip_spaces(outstr);
    13051332                for (i = 0; possible_responses[i]; i++) {
     
    14841511        bool done;
    14851512        char *tmp;
     1513        char *p;
    14861514        char *tmp1 = NULL;
    14871515        FILE *fin, *fout;
     
    15131541                break;
    15141542            }
    1515             (void) fgets(tmp, MAX_NEWT_COMMENT_LEN, fin);
     1543            p = fgets(tmp, MAX_NEWT_COMMENT_LEN, fin);
     1544            if (!p) {
     1545                // FIXME
     1546            }
    15161547            i = (int) strlen(tmp);
    15171548            if (i < 2) {
Note: See TracChangeset for help on using the changeset viewer.