MantisBT - Zandronum
View Issue Details
0003855Zandronum[All Projects] Suggestionpublic2020-08-10 19:052020-08-10 19:05
Filystea 
 
nonefeaturealways
newopen 
openbdsm
 
 
0003855: Somehow on Linux this was never poping out.


Each time i compile I hit this.
upnpnat/xmlParser.c│;
pp:663:27: error:
      cast from pointer to smaller type 'char' loses
      information
        lpszNew[cbData] = (TCHAR)NULL

HERE:

// Duplicate a given string.
LPTSTR stringDup(LPCTSTR lpszData, int cbData)
{
    if (lpszData==NULL) return NULL;

    LPTSTR lpszNew;
    if (cbData==0) cbData=(int)_tcslen(lpszData);
    lpszNew = (LPTSTR)malloc((cbData+1) * sizeof(TCHAR));
    if (lpszNew)
    {
        memcpy(lpszNew, lpszData, (cbData) * sizeof(TCHAR));

// Here was NULL instead of '\0'
        lpszNew[cbData] = (TCHAR)'\0';


    }
    return lpszNew;
}



Feels like I hit some forgotten code.
Cumpile
God forbid
No tags attached.
Issue History
2020-08-10 19:05FilysteaNew Issue

There are no notes attached to this issue.