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/libmondo-filelist.c

    r2972 r3060  
    212212    char *incoming;
    213213    char *tmp = NULL;
     214    char *p = NULL;
    214215
    215216    /*@ pointers *********************************** */
     
    259260    incoming = malloc(MAX_STR_LEN * 2);
    260261
    261     (void) fgets(incoming, MAX_STR_LEN * 2 - 1, fin);
    262     while (!feof(fin)) {
     262    p = fgets(incoming, MAX_STR_LEN * 2 - 1, fin);
     263    while (!feof(fin) && (p != NULL)) {
    263264        lino++;
    264265        i = strlen(incoming) - 1;
     
    307308            }
    308309        }
    309         (void) fgets(incoming, MAX_STR_LEN * 2 - 1, fin);
     310        p = fgets(incoming, MAX_STR_LEN * 2 - 1, fin);
    310311    }
    311312    paranoid_free(incoming);
     
    417418    FILE *pattr;
    418419    char *tmp;
     420    char *p;
     421
    419422    pattr = popen(syscall, "r");
    420423    if (!pattr) {
     
    428431    }
    429432    malloc_string(tmp);
    430     for ((void)fgets(tmp, MAX_STR_LEN, pattr); !feof(pattr);
    431          (void)fgets(tmp, MAX_STR_LEN, pattr)) {
     433    for (p = fgets(tmp, MAX_STR_LEN, pattr); !feof(pattr) && (p != NULL);
     434         p = fgets(tmp, MAX_STR_LEN, pattr)) {
    432435        fputs(tmp, pout);
    433436    }
     
    449452    char *strtmp = NULL;
    450453    char *tmp = NULL;
     454    char *p = NULL;
    451455    int i;
    452456
     
    465469
    466470    malloc_string(file_to_analyze);
    467     for ((void)fgets(file_to_analyze, MAX_STR_LEN, fin); !feof(fin);
    468          (void)fgets(file_to_analyze, MAX_STR_LEN, fin)) {
     471    for (p = fgets(file_to_analyze, MAX_STR_LEN, fin); !feof(fin) && (p != NULL);
     472         p = fgets(file_to_analyze, MAX_STR_LEN, fin)) {
    469473        i = strlen(file_to_analyze);
    470474        if (i > 0 && file_to_analyze[i - 1] < 32) {
     
    535539    int retval = 0;
    536540    int i;
    537     char *p, *q;
     541    char *p, *q, *r;
    538542    char *tmp = NULL;
    539543    FILE *pin, *pout, *faclin;
     
    607611//  printf("Hi there. Starting the loop\n");
    608612
    609     (void)fgets(current_subset_file, MAX_STR_LEN, faclin);
    610     (void)fgets(incoming, MAX_STR_LEN, pin);
    611     while (!feof(pin) && !feof(faclin)) {
     613    r = fgets(current_subset_file, MAX_STR_LEN, faclin);
     614    r = fgets(incoming, MAX_STR_LEN, pin);
     615    while (!feof(pin) && !feof(faclin) && (r != NULL)) {
    612616//      printf("incoming = %s", incoming);
    613617
     
    640644        if (i < 0) {            // read another subset file in.
    641645            log_msg(my_depth, "Reading next subset line in\n\n");
    642             (void)fgets(current_subset_file, MAX_STR_LEN, faclin);
     646            r = fgets(current_subset_file, MAX_STR_LEN, faclin);
    643647            continue;
    644648        }
     
    647651            fputs(incoming, pout);
    648652        }
    649         (void)fgets(incoming, MAX_STR_LEN, pin);
     653        r = fgets(incoming, MAX_STR_LEN, pin);
    650654        if (!i) {
    651655            log_msg(my_depth, "Copying master %s", q);
     
    660664                fputs(incoming, pout);
    661665            }
    662             (void)fgets(incoming, MAX_STR_LEN, pin);
     666            r = fgets(incoming, MAX_STR_LEN, pin);
    663667        }
    664668        if (!i) {
    665             (void)fgets(current_subset_file, MAX_STR_LEN, faclin);
     669            r = fgets(current_subset_file, MAX_STR_LEN, faclin);
    666670        }
    667671    }
    668672    while (!feof(pin)) {
    669         (void)fgets(incoming, MAX_STR_LEN, pin);
     673        r = fgets(incoming, MAX_STR_LEN, pin);
    670674    }
    671675    fclose(faclin);
     
    919923
    920924    open_evalcall_form("Loading filelist from disk");
    921     for ((void)fgets(fname, MAX_STR_LEN, pin); !feof(pin);
    922          (void)fgets(fname, MAX_STR_LEN, pin)) {
     925    for (tmp1 = fgets(fname, MAX_STR_LEN, pin); !feof(pin);
     926         tmp1 = fgets(fname, MAX_STR_LEN, pin)) {
    923927        if ((fname[strlen(fname) - 1] == 13
    924928             || fname[strlen(fname) - 1] == 10) && strlen(fname) > 0) {
     
    13861390        paranoid_free(find_excludes);
    13871391        log_msg(5, "find command = %s", strtmp);
    1388         (void)system(strtmp);
     1392        paranoid_system(strtmp);
    13891393        paranoid_free(strtmp);
    13901394        mr_asprintf(&tmp, "wc -l %s | awk '{print $1;}'", g_skeleton_filelist);
     
    15361540    char *sz_filelist, *tmp;
    15371541    char *exclude_paths = NULL;
    1538     int i;
    15391542    FILE *fout;
    15401543    char *command = NULL;
     
    16291632            fatal_error("Cannot openout to sz_filelist");
    16301633        }
    1631         i = 0;
    16321634        if (strlen(include_paths) == 0) {
    16331635            log_msg(1, "Including only '/' in %s", sz_filelist);
     
    17371739{
    17381740    /*@ int ******************************************************** */
    1739     int noof_chars;
    17401741    static int depth = 0;
    17411742    static char original_string[MAX_STR_LEN];
     
    17551756    assert(startnode != NULL);
    17561757    assert(string_to_find != NULL);
    1757 
    1758     noof_chars = strlen(string_to_find) + 1;    /* we include the '\0' */
    17591758
    17601759    log_msg(7, "starting --- str=%s", string_to_find);
     
    18251824//      fscanf(fin, "%s\n", fname);
    18261825        len = MAX_STR_LEN - 1;
    1827         (void)getline(&fname, &len, fin);   // patch by Scrub
     1826        if (getline(&fname, &len, fin)) {
     1827            // FIXME
     1828        }
    18281829        if (!use_star) {
    18291830            if (fname[0] == '/') {
     
    18791880    FILE *fin;
    18801881    char *tmp;
     1882    char *p;
    18811883    struct s_node *nod;
    18821884
     
    18871889        return (1);
    18881890    }
    1889     for ((void)fgets(tmp, MAX_STR_LEN, fin); !feof(fin);
    1890          (void)fgets(tmp, MAX_STR_LEN, fin)) {
     1891    for (p = fgets(tmp, MAX_STR_LEN, fin); !feof(fin) && (p != NULL);
     1892         p = fgets(tmp, MAX_STR_LEN, fin)) {
    18911893        if (!tmp[0]) {
    18921894            continue;
Note: See TracChangeset for help on using the changeset viewer.