Skip to content

Commit

Permalink
Improve formatting compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
zhgzhg committed Aug 23, 2022
1 parent 91c0e52 commit 260f651
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions geany_unix_timestamp_converter.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ static void receiveAndConvertData(GtkClipboard *clipboard,

if (text != NULL)
{
r = sscanf(text, "%llu.%u", &timestamp, &remainder);
r = sscanf(text, "%llu.%lu", &timestamp, &remainder);
if (r == 0)
{
if (showErrors)
Expand All @@ -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);
Expand Down Expand Up @@ -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)
);
Expand All @@ -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)
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 260f651

Please sign in to comment.