[warnings] fix format string warnings

This commit is contained in:
akallabeth 2023-07-20 09:09:52 +02:00 committed by akallabeth
parent a9aba69567
commit ee078cdda4
4 changed files with 4 additions and 3 deletions

View File

@ -2171,7 +2171,7 @@ const char* freerdp_supported_color_depths_string(UINT16 mask, char* buffer, siz
if (invalid != 0)
{
char str[32] = { 0 };
_snprintf(str, sizeof(str), "RNS_UD_INVALID[0x%04" PRIx16 "]", invalid);
_snprintf(str, sizeof(str), "RNS_UD_INVALID[0x%04" PRIx32 "]", invalid);
winpr_str_append(str, buffer, size, "|");
}
char hex[32] = { 0 };

View File

@ -106,7 +106,7 @@ static char* escape(char* dst, char what)
return dst + 1;
}
sprintf(dst, "%%%02" PRIX8, what & 0xff);
sprintf(dst, "%%%02" PRIX8, (BYTE)(what & 0xff));
return dst + 3;
}

View File

@ -1,5 +1,6 @@
#include <stdio.h>
#include <winpr/wtypes.h>
#include <winpr/crt.h>
#include <winpr/assert.h>
#include <winpr/error.h>

View File

@ -16,7 +16,7 @@ static BOOL TestStream_Verify(wStream* s, size_t mincap, size_t len, size_t pos)
return FALSE;
}
if (Stream_Pointer(s) < Stream_Buffer(s))
if (Stream_PointerAs(s, BYTE) < Stream_Buffer(s))
{
printf("stream pointer (%p) or buffer (%p) is invalid\n", Stream_ConstPointer(s),
(void*)Stream_Buffer(s));