From d04ba8d6efa11d2f5e6b22e1dfea3ae91da66331 Mon Sep 17 00:00:00 2001 From: ehdgks0627 Date: Fri, 28 Jul 2023 18:45:58 +0900 Subject: [PATCH] Correct typos and formatting errors in format strings In several files, fixed typos in format strings that were causing unexpected output and formatting issues. --- channels/audin/client/opensles/audin_opensl_es.c | 2 +- channels/urbdrc/client/data_transfer.c | 2 +- channels/urbdrc/client/libusb/libusb_udevice.c | 2 +- channels/urbdrc/client/libusb/libusb_udevman.c | 2 +- libfreerdp/codec/clear.c | 2 +- libfreerdp/codec/planar.c | 2 +- libfreerdp/codec/progressive.c | 2 +- libfreerdp/codec/rfx.c | 3 +-- libfreerdp/core/connection.c | 2 +- libfreerdp/core/gateway/rdg.c | 4 ++-- libfreerdp/core/gcc.c | 2 +- libfreerdp/core/nego.c | 2 +- libfreerdp/locale/keyboard_xkbfile.c | 2 +- server/proxy/channels/pf_channel_rdpdr.c | 2 +- winpr/test/TestTypes.c | 2 +- 15 files changed, 16 insertions(+), 17 deletions(-) diff --git a/channels/audin/client/opensles/audin_opensl_es.c b/channels/audin/client/opensles/audin_opensl_es.c index 2e5db3689..34df219bf 100644 --- a/channels/audin/client/opensles/audin_opensl_es.c +++ b/channels/audin/client/opensles/audin_opensl_es.c @@ -120,7 +120,7 @@ static BOOL audin_opensles_format_supported(IAudinDevice* device, const AUDIO_FO break; default: - WLog_Print(opensles->log, WLOG_DEBUG, "Encoding '%s' [0x%04X" PRIX16 "] not supported", + WLog_Print(opensles->log, WLOG_DEBUG, "Encoding '%s' [0x%04" PRIX16 "] not supported", audio_format_get_tag_string(format->wFormatTag), format->wFormatTag); break; } diff --git a/channels/urbdrc/client/data_transfer.c b/channels/urbdrc/client/data_transfer.c index 1144682cf..1c75134c7 100644 --- a/channels/urbdrc/client/data_transfer.c +++ b/channels/urbdrc/client/data_transfer.c @@ -1534,7 +1534,7 @@ static UINT urbdrc_process_transfer_request(IUDEVICE* pdev, GENERIC_CHANNEL_CALL Stream_Read_UINT16(s, Size); /** size */ Stream_Read_UINT16(s, URB_Function); Stream_Read_UINT32(s, RequestId); - WLog_Print(urbdrc->log, WLOG_DEBUG, "URB %s[" PRIu16 "]", urb_function_string(URB_Function), + WLog_Print(urbdrc->log, WLOG_DEBUG, "URB %s[%" PRIu16 "]", urb_function_string(URB_Function), URB_Function); switch (URB_Function) diff --git a/channels/urbdrc/client/libusb/libusb_udevice.c b/channels/urbdrc/client/libusb/libusb_udevice.c index e1e558e71..cf80bce33 100644 --- a/channels/urbdrc/client/libusb/libusb_udevice.c +++ b/channels/urbdrc/client/libusb/libusb_udevice.c @@ -550,7 +550,7 @@ static int libusb_udev_select_interface(IUDEVICE* idev, BYTE InterfaceNumber, BY { WLog_Print(urbdrc->log, WLOG_INFO, "select Interface(%" PRIu8 ") curr AlternateSetting(%" PRIu8 - ") new AlternateSetting(" PRIu8 ")", + ") new AlternateSetting(%" PRIu8 ")", InterfaceNumber, MsInterfaces[InterfaceNumber]->AlternateSetting, AlternateSetting); diff --git a/channels/urbdrc/client/libusb/libusb_udevman.c b/channels/urbdrc/client/libusb/libusb_udevman.c index ebe31daf9..c88ca352f 100644 --- a/channels/urbdrc/client/libusb/libusb_udevman.c +++ b/channels/urbdrc/client/libusb/libusb_udevman.c @@ -239,7 +239,7 @@ static size_t udevman_register_udevice(IUDEVMAN* idevman, BYTE bus_number, BYTE } else { - WLog_Print(urbdrc->log, WLOG_ERROR, "udevman_register_udevice: Invalid flag=%08 " PRIx32, + WLog_Print(urbdrc->log, WLOG_ERROR, "udevman_register_udevice: Invalid flag=%08" PRIx32, flag); return 0; } diff --git a/libfreerdp/codec/clear.c b/libfreerdp/codec/clear.c index b122df90e..ca627f197 100644 --- a/libfreerdp/codec/clear.c +++ b/libfreerdp/codec/clear.c @@ -1061,7 +1061,7 @@ INT32 clear_decompress(CLEAR_CONTEXT* clear, const BYTE* pSrcData, UINT32 SrcSiz goto finish; WLog_ERR(TAG, - "invalid glyphFlags, missing flags: 0x%0x" PRIx8 " & 0x%02" PRIx32 + "invalid glyphFlags, missing flags: 0x%02" PRIx8 " & 0x%02" PRIx32 " == 0x%02" PRIx32, glyphFlags, mask, glyphFlags & mask); goto fail; diff --git a/libfreerdp/codec/planar.c b/libfreerdp/codec/planar.c index 1db70335b..368094799 100644 --- a/libfreerdp/codec/planar.c +++ b/libfreerdp/codec/planar.c @@ -1520,7 +1520,7 @@ BYTE* freerdp_bitmap_compress_planar(BITMAP_PLANAR_CONTEXT* context, const BYTE* #if defined(WITH_DEBUG_CODECS) WLog_DBG(TAG, - "R: [%" PRIu32 "/%" PRIu32 "] G: [%" PRIu32 "/%" PRIu32 "] B: [% " PRIu32 + "R: [%" PRIu32 "/%" PRIu32 "] G: [%" PRIu32 "/%" PRIu32 "] B: [%" PRIu32 " / %" PRIu32 "] ", dstSizes[1], planeSize, dstSizes[2], planeSize, dstSizes[3], planeSize); #endif diff --git a/libfreerdp/codec/progressive.c b/libfreerdp/codec/progressive.c index 310eb5166..9027183d7 100644 --- a/libfreerdp/codec/progressive.c +++ b/libfreerdp/codec/progressive.c @@ -1740,7 +1740,7 @@ static INLINE SSIZE_T progressive_process_tiles(PROGRESSIVE_CONTEXT* progressive return -1032; break; default: - WLog_ERR(TAG, "Invalid block type %04 (%s)" PRIx16, blockType, + WLog_ERR(TAG, "Invalid block type %04" PRIx16 " (%s)", blockType, progressive_get_block_type_string(blockType)); return -1039; } diff --git a/libfreerdp/codec/rfx.c b/libfreerdp/codec/rfx.c index b9e32bbdd..2b2930e90 100644 --- a/libfreerdp/codec/rfx.c +++ b/libfreerdp/codec/rfx.c @@ -1283,8 +1283,7 @@ BOOL rfx_process_message(RFX_CONTEXT* context, const BYTE* data, UINT32 length, { region16_uninit(&updateRegion); WLog_Print(context->priv->log, WLOG_ERROR, - "nbUpdateRectx[% " PRIu32 " (%" PRIu32 - ")] freerdp_image_copy failed", + "nbUpdateRectx[%" PRIu32 " (%" PRIu32 ")] freerdp_image_copy failed", j, nbUpdateRects); return FALSE; } diff --git a/libfreerdp/core/connection.c b/libfreerdp/core/connection.c index 650c8473b..6b3bcf7fe 100644 --- a/libfreerdp/core/connection.c +++ b/libfreerdp/core/connection.c @@ -1147,7 +1147,7 @@ BOOL rdp_client_connect_auto_detect(rdpRdp* rdp, wStream* s) } } else - WLog_WARN(TAG, "expected messageChannelId=" PRIu16 ", got %" PRIu16, messageChannelId, + WLog_WARN(TAG, "expected messageChannelId=%" PRIu16 ", got %" PRIu16, messageChannelId, channelId); Stream_SetPosition(s, pos); diff --git a/libfreerdp/core/gateway/rdg.c b/libfreerdp/core/gateway/rdg.c index 7ee4309e0..0f018f63a 100644 --- a/libfreerdp/core/gateway/rdg.c +++ b/libfreerdp/core/gateway/rdg.c @@ -269,7 +269,7 @@ static BOOL rdg_read_http_unicode_string(wStream* s, const WCHAR** string, UINT1 /* Read length of the string */ if (!Stream_CheckAndLogRequiredLength(TAG, s, 4)) { - WLog_ERR(TAG, "Could not read stream length, only have % " PRIuz " bytes", rem); + WLog_ERR(TAG, "Could not read stream length, only have %" PRIuz " bytes", rem); return FALSE; } Stream_Read_UINT16(s, strLenBytes); @@ -280,7 +280,7 @@ static BOOL rdg_read_http_unicode_string(wStream* s, const WCHAR** string, UINT1 /* seek past the string - if this fails something is wrong */ if (!Stream_SafeSeek(s, strLenBytes)) { - WLog_ERR(TAG, "Could not read stream data, only have % " PRIuz " bytes, expected %" PRIu16, + WLog_ERR(TAG, "Could not read stream data, only have %" PRIuz " bytes, expected %" PRIu16, rem - 4, strLenBytes); return FALSE; } diff --git a/libfreerdp/core/gcc.c b/libfreerdp/core/gcc.c index dbb6cd90f..4c53fe3ce 100644 --- a/libfreerdp/core/gcc.c +++ b/libfreerdp/core/gcc.c @@ -2279,7 +2279,7 @@ BOOL gcc_write_client_monitor_data(wStream* s, const rdpMcs* mcs) const UINT32 flags = current->is_primary ? MONITOR_PRIMARY : 0; WLog_DBG(TAG, "Monitor[%" PRIu32 "]: top=%" PRIu32 ", left=%" PRIu32 ", bottom=%" PRIu32 - ", right=%" PRIu32 ", flags" PRIu32, + ", right=%" PRIu32 ", flags=%" PRIu32, i, top, left, bottom, right, flags); Stream_Write_UINT32(s, left); /* left */ Stream_Write_UINT32(s, top); /* top */ diff --git a/libfreerdp/core/nego.c b/libfreerdp/core/nego.c index edc5a7781..81d6702a0 100644 --- a/libfreerdp/core/nego.c +++ b/libfreerdp/core/nego.c @@ -1201,7 +1201,7 @@ static BOOL nego_process_correlation_info(rdpNego* nego, wStream* s) Stream_Seek(s, 16); /* skip reserved bytes */ WLog_INFO(TAG, - "RDP_NEG_CORRELATION_INFO::correlationId = { %02 " PRIx8 ", %02" PRIx8 ", %02" PRIx8 + "RDP_NEG_CORRELATION_INFO::correlationId = { %02" PRIx8 ", %02" PRIx8 ", %02" PRIx8 ", %02" PRIx8 ", %02" PRIx8 ", %02" PRIx8 ", %02" PRIx8 ", %02" PRIx8 ", %02" PRIx8 ", %02" PRIx8 ", %02" PRIx8 ", %02" PRIx8 ", %02" PRIx8 ", %02" PRIx8 ", %02" PRIx8 ", %02" PRIx8 " }", diff --git a/libfreerdp/locale/keyboard_xkbfile.c b/libfreerdp/locale/keyboard_xkbfile.c index 98691b36c..a6a727473 100644 --- a/libfreerdp/locale/keyboard_xkbfile.c +++ b/libfreerdp/locale/keyboard_xkbfile.c @@ -347,7 +347,7 @@ int freerdp_keyboard_init_xkbfile(DWORD* keyboardLayoutId, DWORD x11_keycode_to_ if (*keyboardLayoutId == 0) { detect_keyboard_layout_from_xkbfile(display, keyboardLayoutId); - DEBUG_KBD("detect_keyboard_layout_from_xkb: %" PRIu32 " (0x%08X" PRIX32 ")", + DEBUG_KBD("detect_keyboard_layout_from_xkb: %" PRIu32 " (0x%08" PRIX32 ")", *keyboardLayoutId, *keyboardLayoutId); } diff --git a/server/proxy/channels/pf_channel_rdpdr.c b/server/proxy/channels/pf_channel_rdpdr.c index 263b5db50..419c061f1 100644 --- a/server/proxy/channels/pf_channel_rdpdr.c +++ b/server/proxy/channels/pf_channel_rdpdr.c @@ -463,7 +463,7 @@ static UINT rdpdr_process_client_name_request(pf_channel_server_context* rdpdr, if (!Stream_CheckAndLogRequiredLengthSrv(rdpdr->log, s, rdpdr->common.computerNameLen)) { SERVER_RX_LOG( - rdpdr->log, WLOG_WARN, "[%s | %s]: missing data, got " PRIu32 ", expected %" PRIu32, + rdpdr->log, WLOG_WARN, "[%s | %s]: missing data, got %" PRIu32 ", expected %" PRIu32, rdpdr_component_string(RDPDR_CTYP_CORE), rdpdr_packetid_string(PAKID_CORE_CLIENT_NAME), Stream_GetRemainingLength(s), rdpdr->common.computerNameLen); return ERROR_INVALID_DATA; diff --git a/winpr/test/TestTypes.c b/winpr/test/TestTypes.c index a7257851c..503658eb1 100644 --- a/winpr/test/TestTypes.c +++ b/winpr/test/TestTypes.c @@ -104,7 +104,7 @@ static BOOL test_co_errors(void) const LONG b = should[x]; if (a != b) { - printf("mismatch[%" PRIuz "]: %0x" PRIx32 " vs %08" PRIx32 "\n", x, a, b); + printf("mismatch[%" PRIuz "]: %08" PRIx32 " vs %08" PRIx32 "\n", x, a, b); return FALSE; } }