Changeset 3120


Ignore:
Timestamp:
May 15, 2013, 2:52:16 AM (6 years ago)
Author:
bruno
Message:
  • chop_filelist doesn't truncate files in the file list anymore. Fix a bug for ecryptfs support and is a 3.1 branch patch.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.0/mondo/src/common/libmondo-filelist.c

    r3060 r3120  
    210210    char *outfname = NULL;
    211211    char *biggie_fname = NULL;
    212     char *incoming;
     212    char *incoming = NULL;
    213213    char *tmp = NULL;
    214214    char *p = NULL;
     
    258258        return (curr_set_no + 1);
    259259    }
    260     incoming = malloc(MAX_STR_LEN * 2);
    261 
    262     p = fgets(incoming, MAX_STR_LEN * 2 - 1, fin);
    263     while (!feof(fin) && (p != NULL)) {
     260
     261    mr_getline(incoming, fin);
     262    while (!feof(fin)) {
    264263        lino++;
    265264        i = strlen(incoming) - 1;
    266265        if (i < 0) {
    267266            i = 0;
    268         }
    269         if (i > MAX_STR_LEN - 1) {
    270             incoming[MAX_STR_LEN - 30] = '\0';
    271             log_msg(1, "Warning - truncating file %s's name", incoming);
    272             err++;
    273267        }
    274268        if (incoming[i] < 32) {
     
    302296                    mr_free(outfname);
    303297                    mr_free(biggie_fname);
    304                     paranoid_free(incoming);
     298                    mr_free(incoming);
    305299                    return (curr_set_no + 1);
    306300                }
     
    308302            }
    309303        }
    310         p = fgets(incoming, MAX_STR_LEN * 2 - 1, fin);
    311     }
    312     paranoid_free(incoming);
     304        mr_free(incoming);
     305        mr_getline(incoming, fin);
     306    }
     307    mr_free(incoming);
     308
    313309    paranoid_fclose(fin);
    314310    paranoid_fclose(fout);
Note: See TracChangeset for help on using the changeset viewer.