Yes, I think you understood perfectly what I was assuming, which was wrong.
I rewrote the signature and implementation as
void PathUtil
::toWinAscii(QString fullpath,
char *destination
) {
char *s = ba.data();
#if WIN32
char *p = destination;
while(*p){if(*p == '/')*p = '\\'; p++;}
#endif*
strcpy(destination, s);
}
void PathUtil::toWinAscii(QString fullpath, char *destination)
{
QByteArray ba = fullpath.toLocal8Bit();
char *s = ba.data();
#if WIN32
char *p = destination;
while(*p){if(*p == '/')*p = '\\'; p++;}
#endif*
strcpy(destination, s);
}
To copy to clipboard, switch view to plain text mode
and assuming that destination is allocated this works fine.
Thankyou
Bookmarks