Ignore:
Timestamp:
Dec 29, 2011, 5:04:29 PM (14 years ago)
Author:
dmik
Message:

Fix crash when doing drag & drop.

This is a regression after switching to GCC: tmpnam() returns
forward slashes, while the code expected backward ones.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/oslibdnd.cpp

    r21556 r21928  
    6363    char szDir[CCHMAXPATH*4];
    6464   
    65     pszFile = (char *)malloc(CCHMAXPATH+1);
     65    pszFile = tempnam(0, 0);
    6666    if(pszFile == NULL) {
    6767        DebugInt3();
     
    7070    }
    7171
    72     tmpnam(pszFile);
    7372    strcpy(szDir, pszFile);
    7473
    7574    char *tmp = strrchr(szDir, '\\');
     75    if (!tmp)
     76        tmp = strrchr(szDir, '/');
     77    if (!tmp) {
     78        DebugInt3();
     79        free(pszFile);
     80        DrgFreeDraginfo(pdinfo);
     81        return NULL;
     82    }
     83
    7684    *tmp = 0;
    7785    tmp++;
Note: See TracChangeset for help on using the changeset viewer.