[warnings] annotate cert-err34-c

This commit is contained in:
akallabeth 2024-09-30 22:45:08 +02:00
parent f6eb6ad4d7
commit fe8555a4fd
No known key found for this signature in database
GPG Key ID: A49454A3FC909FD5
4 changed files with 7 additions and 1 deletions

View File

@ -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)
{

View File

@ -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;

View File

@ -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)

View File

@ -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");