Opened 5 years ago

Closed 4 years 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@… 5 years ago.

Download all attachments as: .zip

Change History (5)

by HoraK-FDF@…, 5 years ago

comment:1 by Thomas Bernard, 5 years ago

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

It looks like I miscalculated the available string lenght :(

comment:2 by Thomas Bernard, 4 years ago

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

comment:3 by Thomas Bernard, 4 years ago

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 by Thomas Bernard, 4 years ago

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