Changeset 7019


Ignore:
Timestamp:
Nov 2, 2008, 3:58:30 PM (12 years ago)
Author:
charles
Message:

(libT) fix bug in getting win32 home directory

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/platform.c

    r6992 r7019  
    271271        {
    272272#ifdef WIN32
    273             SHGetFolderPath( NULL, CSIDL_MYDOCUMENTS, NULL, 0, home );
     273            char appdata[MAX_PATH]; /* SHGetFolderPath() requires MAX_PATH */
     274            *appdata = '\0';
     275            SHGetFolderPath( NULL, CSIDL_MYDOCUMENTS, NULL, 0, appdata );
     276            home = tr_strdup( appdata );
    274277#elif defined( __BEOS__ ) || defined( __AMIGAOS4__ )
    275278            home = tr_strdup( "" );
     
    309312        path = tr_strdup( "PROGDIR:.transmission" );
    310313#elif defined( WIN32 )
    311         char appdata[MAX_PATH_LENGTH];
     314        char appdata[MAX_PATH]; /* SHGetFolderPath() requires MAX_PATH */
    312315        SHGetFolderPath( NULL, CSIDL_APPDATA, NULL, 0, appdata );
    313316        path = tr_buildPath( appdata, "Transmission", NULL );
Note: See TracChangeset for help on using the changeset viewer.