From fe8555a4fd684b32abb9d4656eee36398b170d14 Mon Sep 17 00:00:00 2001 From: akallabeth Date: Mon, 30 Sep 2024 22:45:08 +0200 Subject: [PATCH] [warnings] annotate cert-err34-c --- channels/printer/client/cups/printer_cups.c | 2 ++ libfreerdp/codec/test/TestFreeRDPCodecProgressive.c | 2 ++ libfreerdp/primitives/test/TestPrimitivesYUV.c | 3 ++- libfreerdp/utils/http.c | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/channels/printer/client/cups/printer_cups.c b/channels/printer/client/cups/printer_cups.c index 6a80bdece..b61ad1723 100644 --- a/channels/printer/client/cups/printer_cups.c +++ b/channels/printer/client/cups/printer_cups.c @@ -65,6 +65,8 @@ static bool is_mac_os_sonoma_or_later(void) int major = 0; int minor = 0; int patch = 0; + + // NOLINTNEXTLINE(cert-err34-c) const int rc = sscanf(str, "%d.%d.%d", &major, &minor, &patch); if (rc != 3) { diff --git a/libfreerdp/codec/test/TestFreeRDPCodecProgressive.c b/libfreerdp/codec/test/TestFreeRDPCodecProgressive.c index 869ebaa37..23d1fc514 100644 --- a/libfreerdp/codec/test/TestFreeRDPCodecProgressive.c +++ b/libfreerdp/codec/test/TestFreeRDPCodecProgressive.c @@ -1122,6 +1122,7 @@ static BOOL read_cmd(FILE* fp, RDPGFX_SURFACE_COMMAND* cmd, UINT32* frameId) WINPR_ASSERT(cmd); WINPR_ASSERT(frameId); + // NOLINTBEGIN(cert-err34-c) if (1 != fscanf(fp, "frameid: %" PRIu32 "\n", frameId)) return FALSE; if (1 != fscanf(fp, "surfaceId: %" PRIu32 "\n", &cmd->surfaceId)) @@ -1146,6 +1147,7 @@ static BOOL read_cmd(FILE* fp, RDPGFX_SURFACE_COMMAND* cmd, UINT32* frameId) return FALSE; if (1 != fscanf(fp, "length: %" PRIu32 "\n", &cmd->length)) return FALSE; + // NOLINTEND(cert-err34-c) char* data = NULL; diff --git a/libfreerdp/primitives/test/TestPrimitivesYUV.c b/libfreerdp/primitives/test/TestPrimitivesYUV.c index 5308b6b0c..a71790758 100644 --- a/libfreerdp/primitives/test/TestPrimitivesYUV.c +++ b/libfreerdp/primitives/test/TestPrimitivesYUV.c @@ -896,10 +896,11 @@ int TestPrimitivesYUV(int argc, char* argv[]) for (UINT32 x = 0; x < 5; x++) { - prim_size_t roi; + prim_size_t roi = { 0 }; if (argc > 1) { + // NOLINTNEXTLINE(cert-err34-c) int crc = sscanf(argv[1], "%" PRIu32 "x%" PRIu32, &roi.width, &roi.height); if (crc != 2) diff --git a/libfreerdp/utils/http.c b/libfreerdp/utils/http.c index aa14677a9..66894e7a3 100644 --- a/libfreerdp/utils/http.c +++ b/libfreerdp/utils/http.c @@ -221,6 +221,7 @@ BOOL freerdp_http_request(const char* url, const char* body, long* status_code, goto out; } + // NOLINTNEXTLINE(cert-err34-c) if (sscanf(buffer, "HTTP/1.1 %li %*[^\r\n]\r\n", status_code) < 1) { WLog_Print(log, WLOG_ERROR, "invalid HTTP status line");