mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 08:25:03 +00: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:
parent
b275f24406
commit
95b3eebf71
1 changed files with 2 additions and 2 deletions
|
@ -80,8 +80,8 @@ int CDECL MSVCRT_I10_OUTPUT(_LDOUBLE ld80, int prec, int flag, struct _I10_OUTPU
|
||||||
prec = 0;
|
prec = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(format, "%%.%dle", prec);
|
sprintf_s(format, sizeof(format), "%%.%dle", prec);
|
||||||
sprintf(buf, format, d);
|
sprintf_s(buf, sizeof(buf), format, d);
|
||||||
|
|
||||||
buf[1] = buf[0];
|
buf[1] = buf[0];
|
||||||
data->pos = atoi(buf+prec+3);
|
data->pos = atoi(buf+prec+3);
|
||||||
|
|
Loading…
Reference in a new issue