From 69347de37b24f4bb1a421dc20673794cea7e11f6 Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Mon, 11 Apr 2022 14:10:40 +0000 Subject: [PATCH] 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 Commit-Queue: Dan Sinclair Auto-Submit: Dan Sinclair --- src/dawn/CPPLINT.cfg | 1 - src/dawn/tests/DawnTest.cpp | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/dawn/CPPLINT.cfg b/src/dawn/CPPLINT.cfg index 7b240de37c..d2c79b20eb 100644 --- a/src/dawn/CPPLINT.cfg +++ b/src/dawn/CPPLINT.cfg @@ -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 diff --git a/src/dawn/tests/DawnTest.cpp b/src/dawn/tests/DawnTest.cpp index 30a45038a6..f1d452bb00 100644 --- a/src/dawn/tests/DawnTest.cpp +++ b/src/dawn/tests/DawnTest.cpp @@ -95,7 +95,7 @@ namespace { auto byteView = reinterpret_cast(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; } }