Ignore:
Timestamp:
Dec 30, 2008, 3:29:09 AM (12 years ago)
Author:
charles
Message:

(trunk libT) eliminate a couple more unnecessary malloc() + free() pairs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/inout.c

    r7531 r7543  
    7474
    7575    typedef size_t ( *iofunc )( int, void *, size_t );
    76     iofunc          func = ioMode ==
    77                            TR_IO_READ ? (iofunc)read : (iofunc)write;
    78     char          * path;
     76    iofunc          func = ioMode == TR_IO_READ ? (iofunc)read : (iofunc)write;
    7977    struct stat     sb;
    8078    int             fd = -1;
     
    8785    assert( fileOffset + buflen <= file->length );
    8886
    89     path = tr_buildPath( tor->downloadDir, file->name, NULL );
    90     fileExists = !stat( path, &sb );
    91     tr_free( path );
     87    {
     88        char path[MAX_PATH_LENGTH];
     89        tr_snprintf( path, sizeof( path ), "%s%c%s", tor->downloadDir, TR_PATH_DELIMITER, file->name );
     90        fileExists = !stat( path, &sb );
     91    }
    9292
    9393    if( !file->length )
Note: See TracChangeset for help on using the changeset viewer.