Changeset 8308


Ignore:
Timestamp:
Apr 28, 2009, 8:42:55 PM (13 years ago)
Author:
charles
Message:

(trunk libT) silently add a \0 after the end of files read by tr_loadFile() so that text files can be handled directly as ascii strings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/utils.c

    r8299 r8308  
    498498        return NULL;
    499499    }
    500     buf = malloc( sb.st_size );
     500    buf = malloc( sb.st_size + 1 );
    501501    if( !buf )
    502502    {
     
    518518
    519519    tr_close_file( fd );
     520    buf[ sb.st_size ] = '\0';
    520521    *size = sb.st_size;
    521522    return buf;
Note: See TracChangeset for help on using the changeset viewer.