Opened 12 months ago

Closed 5 months ago

#131 closed defect (fixed)

Statistic window - string overlaps border

Reported by: HoraK-FDF@… Owned by: Thomas Bernard
Priority: minor Milestone: 2.7
Component: GrafX2 Version: 2.7
Keywords: Cc:

Description

Hi,

as summary says, I'm attaching a picture.

gfx2: grafx2-2.7wip2732-issue_123

Attachments (1)

gfx2_string_overlaps_border-01.png (6.0 KB) - added by HoraK-FDF@… 12 months ago.

Download all attachments as: .zip

Change History (5)

Changed 12 months ago by HoraK-FDF@…

comment:1 Changed 12 months ago by Thomas Bernard

Milestone: 2.7
Owner: changed from pulkomandy to Thomas Bernard
Status: newaccepted

It looks like I miscalculated the available string lenght :(

comment:2 Changed 5 months ago by Thomas Bernard

hum I don't reproduce with a .exe compiled with MS VS2015

comment:3 Changed 5 months ago by Thomas Bernard

OK :
https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/snprintf-snprintf-snprintf-l-snwprintf-snwprintf-l?view=vs-2019

Ensure that format is not a user-defined string. Because the _snprintf functions do not guarantee null termination—in particular, when the return value is count—make sure that they are followed by code that adds the null terminator.
[...]
Beginning with the UCRT in Visual Studio 2015 and Windows 10, snprintf is no longer identical to _snprintf. The snprintf function behavior is now C99 standard compliant.

comment:4 Changed 5 months ago by Thomas Bernard

Resolution: fixed
Status: acceptedclosed
Note: See TracTickets for help on using tickets.