Ignore:
Timestamp:
Jun 19, 2013, 8:34:46 AM (7 years ago)
Author:
Bruno Cornec
Message:
  • First pass on svn merge -r 2935:3146 ../3.0
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.1/mondo/src/common/libmondo-fork.c

    r2937 r3147  
    4242    char *newcall = NULL;
    4343    char *tmp = NULL;
     44    char *p;
    4445
    4546    /*@ pointers **************************************************** */
     
    258259    FILE *fin;
    259260    char *p;
     261    char *q;
    260262
    261263    /*@ end vars *************************************************** */
     
    300302    fin = fopen(tmp1, "r");
    301303    if (fin) {
    302         for (fgets(incoming, MAX_STR_LEN, fin); !feof(fin); fgets(incoming, MAX_STR_LEN, fin)) {
     304        for (q = fgets(incoming, MAX_STR_LEN, fin); !feof(fin) && (q != NULL); q = fgets(incoming, MAX_STR_LEN, fin)) {
    303305            p = incoming;
    304306            while (p && *p) {
     
    545547                log_msg(1, "bytes_read_in = %ld", bytes_read_in);
    546548
    547                 fwrite(tmp1, 1, bytes_read_in, ftmp);
    548                 fread(tmp1, 1, tmpcap, fin);
    549                 log_msg(0, "tmp1 = '%s'", tmp1);
    550                 fwrite(tmp1, 1, tmpcap, ftmp);
     549                if (fwrite(tmp, 1, bytes_read_in, ftmp)) {
     550                    fatal_error("Can't fwrite here");
     551                }
     552
     553                sprintf(tmp, "I am here - %lld", (long long)ftello(fin));
     554                if (fread(tmp, 1, tmpcap, fin)) {
     555                    fatal_error("Can't fread here");
     556                }
     557                log_msg(0, "tmp = '%s'", tmp);
     558                if (fwrite(tmp, 1, tmpcap, ftmp)) {
     559                    fatal_error("Can't fwrite there");
     560                }
    551561                fclose(ftmp);
    552562                mr_free(tmp1);
Note: See TracChangeset for help on using the changeset viewer.