mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[VFATLIB] Use RtlStringCbPrintfA instead of sprintf
Fixes GCC 8 warning: sdk/lib/fslib/vfatlib/check/boot.c:173:27: error: '%02x' directive writing between 2 and 8 bytes into a region of size between 0 and 15 [-Werror=format-overflow=] sprintf(buf, "%s%u:%02x/%02x", first ? "" : ", ", ^~~~ sdk/lib/fslib/vfatlib/check/boot.c:173:16: note: directive argument in the range [0, 2147483647] sprintf(buf, "%s%u:%02x/%02x", first ? "" : ", ", ^~~~~~~~~~~~~~~~ sdk/lib/fslib/vfatlib/check/boot.c:173:3: note: 'sprintf' output between 8 and 31 bytes into a destination of size 20 sprintf(buf, "%s%u:%02x/%02x", first ? "" : ", ", ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned)(p - (uint8_t *) b), *p, *q); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This commit is contained in:
parent
ddb56e8cca
commit
b275f24406
1 changed files with 7 additions and 0 deletions
|
@ -26,6 +26,9 @@
|
|||
* by Roman Hodek <Roman.Hodek@informatik.uni-erlangen.de> */
|
||||
|
||||
#include "vfatlib.h"
|
||||
#ifdef __REACTOS__
|
||||
#include <ntstrsafe.h>
|
||||
#endif // __REACTOS__
|
||||
|
||||
#define NDEBUG
|
||||
#include <debug.h>
|
||||
|
@ -170,7 +173,11 @@ static void check_backup_boot(DOS_FS * fs, struct boot_sector *b, unsigned int l
|
|||
for (p = (uint8_t *) b, q = (uint8_t *) & b2, i = 0; i < sizeof(b2);
|
||||
++p, ++q, ++i) {
|
||||
if (*p != *q) {
|
||||
#ifndef __REACTOS__
|
||||
sprintf(buf, "%s%u:%02x/%02x", first ? "" : ", ",
|
||||
#else
|
||||
RtlStringCbPrintfA(buf, sizeof(buf), "%s%u:%02x/%02x", first ? "" : ", ",
|
||||
#endif // __REACTOS__
|
||||
(unsigned)(p - (uint8_t *) b), *p, *q);
|
||||
if (pos + strlen(buf) > 78)
|
||||
printf("\n "), pos = 2;
|
||||
|
|
Loading…
Reference in a new issue