Changeset 1138 in MondoRescue for branches/stable/mondo/src/lib


Ignore:
Timestamp:
Feb 11, 2007, 3:08:34 PM (17 years ago)
Author:
Bruno Cornec
Message:

mr_getline should test for feof as getline returns also -1 in that case.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mondo/src/lib/mr_mem.c

    r1133 r1138  
    5454
    5555/* encapsulation function for getline */
    56 void mr_getline_int(char **lineptr, size_t *n, FILE *stream, int line, const char *file) {
     56void mr_getline_int(char **lineptr, size_t *n, FILE *fd, int line, const char *file) {
    5757   
    5858    ssize_t ret;
    5959
    60     ret = getline(lineptr,n,stream);
    61     if (ret == -1) {
     60    ret = getline(lineptr,n,fd);
     61    if ((ret == -1) && (! feof(fd))) {
    6262        mr_msg_int(1,line,file,"Unable to alloc memory in mr_getline\nExiting...");
    6363        mr_exit(-1,"Unable to alloc memory in mr_getline");
Note: See TracChangeset for help on using the changeset viewer.