Pelles C forum

Pelles C => Bug reports => Topic started by: matze on September 14, 2019, 08:44:10 PM

Title: Char \0 in UNICODE strings
Post by: matze on September 14, 2019, 08:44:10 PM
If a Unicode string consists of several consecutive strings, problems occur when accessing the strings.
For this I have created two test programs with Pelles C 9.00.9 (see pictures).
In the first picture everything works as expected.
In the second picture you can see the test program slightly modified: A space has been replaced by the character \0.
The source code tries to put the pointer string2 on the first character after the character \0. As can be seen in the second picture, this did not work out, because the debugger displays strange values when the variable string2 is shown.
Title: Re: Char \0 in UNICODE strings
Post by: TimoVJL on September 15, 2019, 01:53:54 AM
lstrcpy copy only 4 TCHARs to string, so the rest are just current stack values.