This is the only way to test if the return string is empty. Each fails in the other’s architecture. The question is why? Why does !=NULL fail on x86 and _tcslen(*sDateOut)>0 fail on x64?:
BOOL FormatDate(TCHAR *sIn, TCHAR **sOut) {
free(*sOut);*sOut=NULL; // Clear
...
if (condition1)
*sOut = calloc(length,sizeof(TCHAR);
...
#ifdef WIN64
return (*sOut != NULL);
#else
return (_tcslen(*sOut)>0);
#endif
}
If you want to check for an empty string you should compare the first character with
'\0', notNULL.The reason for this is because
NULLis supposed to represent a null pointer – it’s actual value may not actually be zero.Now back to the example, if you want to test if
TCHAR **sOutis a valid pointer to an empty string this test should work: