mirror of
https://github.com/reactos/reactos.git
synced 2026-05-25 17:45:16 +08:00
[CRT] Use sprintf_s instead of sprintf
Fixes GCC 8 warning:
sdk/lib/crt/misc/i10output.c:83:25: error: '%d' directive writing between 1 and 11 bytes into a region of size 6 [-Werror=format-overflow=]
sprintf(format, "%%.%dle", prec);
^~
sdk/lib/crt/misc/i10output.c:83:21: note: directive argument in the range [-2147483648, 2147483646]
sprintf(format, "%%.%dle", prec);
^~~~~~~~~
sdk/lib/crt/misc/i10output.c:83:5: note: 'sprintf' output between 6 and 16 bytes into a destination of size 8
sprintf(format, "%%.%dle", prec);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This commit is contained in:
@@ -80,8 +80,8 @@ int CDECL MSVCRT_I10_OUTPUT(_LDOUBLE ld80, int prec, int flag, struct _I10_OUTPU
|
||||
prec = 0;
|
||||
}
|
||||
|
||||
sprintf(format, "%%.%dle", prec);
|
||||
sprintf(buf, format, d);
|
||||
sprintf_s(format, sizeof(format), "%%.%dle", prec);
|
||||
sprintf_s(buf, sizeof(buf), format, d);
|
||||
|
||||
buf[1] = buf[0];
|
||||
data->pos = atoi(buf+prec+3);
|
||||
|
||||
Reference in New Issue
Block a user