Enable runtime/printf

This CL changes the single `sprintf` to an `snprintf` which allows the
runtime/printf lint check to be enabled.

Change-Id: Ieed654a8d5f23250e4bc8ee07001489a060f8dc5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86084
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: Dan Sinclair <dsinclair@chromium.org>
This commit is contained in:
dan sinclair 2022-04-11 14:10:40 +00:00 committed by Dawn LUCI CQ
parent 13d88a6438
commit 69347de37b
2 changed files with 1 additions and 2 deletions

View File

@ -11,5 +11,4 @@ filter=-readability/namespace
filter=-runtime/explicit
filter=-runtime/indentation_namespace
filter=-runtime/int
filter=-runtime/printf
filter=-whitespace/empty_if_body

View File

@ -95,7 +95,7 @@ namespace {
auto byteView = reinterpret_cast<const uint8_t*>(buffer + index);
for (unsigned int b = 0; b < kBytes; ++b) {
char buf[4];
sprintf(buf, "%02X ", byteView[b]);
snprintf(buf, 4, "%02X ", byteView[b]);
result << buf;
}
}