Changeset 2529 for trunk


Ignore:
Timestamp:
Sep 20, 2011 8:39:03 PM (13 years ago)
Author:
dkearney
Message:

updating the fortran showdata example and the c++ getFile and fortran's
rp_lib_get_file functions to correctly return the number of bytes written to
the file.

Location:
trunk
Files:
4 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/core/RpBuffer.cc

    r2463 r2529  
    168168    }
    169169    ssize_t nWritten;
    170     nWritten = fwrite(bytes(), size(), sizeof(char), f);
     170    nWritten = fwrite(bytes(), sizeof(char), size(), f);
    171171    fclose(f);                        // Close the file.
    172172
    173173    if (nWritten != (ssize_t)size()) {
    174         status.addError("can't write %d bytes to \"%s\": %s\n", size(), 
     174        status.addError("can't write %d bytes to \"%s\": %s\n", size(),
    175175                        path, strerror(errno));
    176176        return false;
  • trunk/src/core/RpLibraryFInterface.cc

    r2408 r2529  
    618618{
    619619    size_t nbytes = 0;
    620     int ret = 0;
    621620
    622621    RpLibrary* lib = NULL;
     
    636635    }
    637636
    638     if (nbytes > 0) {
    639         ret = 1;
    640     }
    641 
    642     return ret;
     637    return nbytes;
    643638}
    644639
Note: See TracChangeset for help on using the changeset viewer.