[easytag/wip/clang-analyzer: 12/14] Fix arguments passed to Log_Print()
- From: David King <davidk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [easytag/wip/clang-analyzer: 12/14] Fix arguments passed to Log_Print()
- Date: Mon, 12 Aug 2013 15:46:13 +0000 (UTC)
commit db1580b731ee5075ee2f3ea6b6f1a082c09bd4de
Author: David King <amigadave amigadave com>
Date: Mon Aug 12 16:40:26 2013 +0100
Fix arguments passed to Log_Print()
The recent change to mark Log_Print() as a printf-style function exposed
a few instances where an incorrect format specifier was used.
src/id3v24_tag.c | 11 ++++++++---
src/misc.c | 2 +-
2 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/src/id3v24_tag.c b/src/id3v24_tag.c
index c53be48..f706fda 100644
--- a/src/id3v24_tag.c
+++ b/src/id3v24_tag.c
@@ -1336,10 +1336,11 @@ etag_write_tags (const gchar *filename,
char tmp[ID3_TAG_QUERYSIZE];
int fd;
int curpos;
- long filev2size, ctxsize;
+ long filev2size;
+ gsize ctxsize;
char *ctx = NULL;
int err = 0;
- long size_read = 0;
+ gssize size_read = 0;
v1buf = v2buf = NULL;
if ( !strip_tags )
@@ -1488,7 +1489,11 @@ etag_write_tags (const gchar *filename,
gchar *filename_utf8 = filename_to_display(filename);
gchar *basename_utf8 = g_path_get_basename(filename_utf8);
- Log_Print(LOG_ERROR,_("Cannot write tag of file '%s' (%d bytes were read but %d bytes were
expected)"),basename_utf8,size_read,ctxsize);
+ Log_Print (LOG_ERROR,
+ _("Cannot write tag of file '%s' (%" G_GSSIZE_FORMAT
+ " bytes were read but %" G_GSIZE_FORMAT
+ " bytes were expected)"),
+ basename_utf8, size_read, ctxsize);
g_free(filename_utf8);
g_free(basename_utf8);
goto out;
diff --git a/src/misc.c b/src/misc.c
index d55c397..5d5b777 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -784,7 +784,7 @@ Run_Audio_Player_Using_File_List (GList *etfilelist)
if ( !(program_path = Check_If_Executable_Exists(AUDIO_FILE_PLAYER)) )
{
gchar *msg = g_strdup_printf(_("The program '%s' cannot be found"),AUDIO_FILE_PLAYER);
- Log_Print(LOG_ERROR,msg);
+ Log_Print (LOG_ERROR, "%s", msg);
g_free(msg);
return;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]