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-mountlist.c

    r2944 r3060  
    5050    int pos = 0, npos = 0;
    5151    int res = 0;
    52     int mountpoint_copies = 0;
    5352    int device_copies = 0;
    5453    int i = 0;
     
    111110            }
    112111            /* does partition /dev/adXsYZ exist more than once in the mountlist? */
    113             for (i = 0, mountpoint_copies = 0, device_copies = 0;
     112            for (i = 0, device_copies = 0;
    114113                 i < mountlist->entries; i++) {
    115114                if (!strcmp(device, mountlist->el[i].device)) {
     
    208207            }
    209208            /* does partition /dev/adXsY exist more than once in the mountlist? */
    210             for (i = 0, mountpoint_copies = 0, device_copies = 0;
     209            for (i = 0, device_copies = 0;
    211210                 i < mountlist->entries; i++) {
    212211                if (!strcmp(device, mountlist->el[i].device)) {
     
    271270                }
    272271                /* does partition /dev/adXsYZ exist more than once in the mountlist? */
    273                 for (i = 0, mountpoint_copies = 0, device_copies = 0;
     272                for (i = 0, device_copies = 0;
    274273                     i < mountlist->entries; i++) {
    275274                    if (!strcmp(device, mountlist->el[i].device)) {
     
    372371    int pos = 0;
    373372    int res = 0;
    374     int mountpoint_copies = 0;
    375373    int device_copies = 0;
    376374    int i = 0;
     
    454452        }
    455453        /* does partition /dev/hdNX exist more than once in the mountlist? */
    456         for (i = 0, mountpoint_copies = 0, device_copies = 0;
     454        for (i = 0, device_copies = 0;
    457455             i < mountlist->entries; i++) {
    458456            if (!strcmp(device, mountlist->el[i].device)) {
     
    812810    char *tmp = NULL;
    813811    char *p = NULL;
     812    char *q = NULL;
    814813
    815814    int items = 0;
     
    827826    malloc_string(incoming);
    828827    malloc_string(siz);
    829     (void) fgets(incoming, MAX_STR_LEN - 1, fin);
     828    q = fgets(incoming, MAX_STR_LEN - 1, fin);
    830829    log_it("Loading mountlist...");
    831     while (!feof(fin)) {
     830    while (!feof(fin) && (q != NULL)) {
    832831#if linux
    833832        res = sscanf(incoming,
     
    863862                    "Ignoring %s in mountlist - not loading that line :) ",
    864863                    mountlist->el[items].device);
    865             (void) fgets(incoming, MAX_STR_LEN - 1, fin);
     864            q = fgets(incoming, MAX_STR_LEN - 1, fin);
    866865            continue;
    867866        }
     
    906905            }
    907906        }
    908         (void) fgets(incoming, MAX_STR_LEN - 1, fin);
     907        q = fgets(incoming, MAX_STR_LEN - 1, fin);
    909908    }
    910909    paranoid_fclose(fin);
Note: See TracChangeset for help on using the changeset viewer.