if I pass a string (!) to FlattenVar //ok, it's maybe odd, but let's follow the white rabbit....
then the string length is 1 more than originally.
e.g,
s=FlattenVar("world");
l=strlen(s); // says : 6!
if I write it on the screen, then there indeed is an additional blank behind:
Code: Select all
TextOut(0,0,s+"<"); // says: world < , with a blank in between.
s=FlattenVar("world");
s2=StrCat("hello ",s,"!");
Code: Select all
TextOut(0,0,s2); // says: hello world (...lots of blanks...) ... without the final "!"
strncpy(s,s,strlen(s)-1); // shorten string by 1 and terminate
s2=StrCat("hello ",s,"!");
Code: Select all
TextOut(0,0,s2); // says correctly: hello world! (with final "!" and without any white space)
s=FlattenVar("world")+"\0";
- or do I miss something else?