From 260f651b251f07d14fb9f67e286c955a1ce57b65 Mon Sep 17 00:00:00 2001 From: zhgzhg Date: Tue, 23 Aug 2022 22:33:55 +0300 Subject: [PATCH] Improve formatting compatibility --- geany_unix_timestamp_converter.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/geany_unix_timestamp_converter.c b/geany_unix_timestamp_converter.c index f2ac27d..75fb001 100644 --- a/geany_unix_timestamp_converter.c +++ b/geany_unix_timestamp_converter.c @@ -102,7 +102,7 @@ static void receiveAndConvertData(GtkClipboard *clipboard, if (text != NULL) { - r = sscanf(text, "%llu.%u", ×tamp, &remainder); + r = sscanf(text, "%llu.%lu", ×tamp, &remainder); if (r == 0) { if (showErrors) @@ -112,7 +112,7 @@ static void receiveAndConvertData(GtkClipboard *clipboard, strcpy(output, "No numerical data was recognized!"); msgwin_msg_add(COLOR_RED, -1, (GeanyDocument*) document, - (const gchar*) output); + "%s", output); if (showResultInMsgPopupWindow) dialogs_show_msgbox(GTK_MESSAGE_INFO, "%s", output); @@ -153,7 +153,7 @@ static void receiveAndConvertData(GtkClipboard *clipboard, remainder); snprintf(finalOutputGPSTs, sizeof(finalOutputGPSTs), - "\nGPS Timestamp Equivalent: %d; Without leaps: %d", + "\nGPS Timestamp Equivalent: %ld; Without leaps: %ld", unixTs2GPSTs(realTimestamp, TRUE), unixTs2GPSTs(realTimestamp, FALSE) ); @@ -164,7 +164,7 @@ static void receiveAndConvertData(GtkClipboard *clipboard, strcat(finalOutput, finalOutputGPSTs); msgwin_msg_add(COLOR_BLUE, -1, (GeanyDocument*) document, - "%llu.%u is equal to\n%s", timestamp, + "%llu.%lu is equal to\n%s", timestamp, remainder, finalOutput); if (showResultInMsgPopupWindow) @@ -197,7 +197,7 @@ static void receiveAndConvertData(GtkClipboard *clipboard, if (showErrors) { msgwin_msg_add(COLOR_RED, -1, (GeanyDocument*) document, - noDataMsg); + "%s", noDataMsg); if (showResultInMsgPopupWindow) dialogs_show_msgbox(GTK_MESSAGE_INFO, "%s", noDataMsg); @@ -230,7 +230,7 @@ static void unixts_to_string(GeanyDocument *doc) if (showErrors) { - msgwin_msg_add(COLOR_RED, -1, doc, noDataMsg); + msgwin_msg_add(COLOR_RED, -1, doc, "%s", noDataMsg); if (showResultInMsgPopupWindow) dialogs_show_msgbox(GTK_MESSAGE_INFO, "%s", noDataMsg);