From 098facb0f7b86cc838cbf32d7e57ab1a4e2110d9 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Mon, 1 May 2006 08:09:39 +0000 Subject: It's g_strdup_printf(), not g_sprintf_alloc(). Declare "error", and properly terminate a string. svn path=/trunk/; revision=18054 --- epan/filesystem.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'epan') diff --git a/epan/filesystem.c b/epan/filesystem.c index dce300ae18..24b9300599 100644 --- a/epan/filesystem.c +++ b/epan/filesystem.c @@ -224,6 +224,7 @@ init_progfile_dir(const char *arg0 TCHAR prog_pathname_w[_MAX_PATH+2]; size_t progfile_dir_len; char *prog_pathname; + DWORD error; TCHAR *msg_w; guchar *msg; size_t msglen; @@ -272,7 +273,7 @@ init_progfile_dir(const char *arg0 /* * OK, no \ - what do we do now? */ - return g_sprintf_alloc("No \\ in executable pathname \"%s\", + return g_strdup_printf("No \\ in executable pathname \"%s\"", prog_pathname); } } else { @@ -285,7 +286,7 @@ init_progfile_dir(const char *arg0 /* * Gak. We can't format the message. */ - return g_sprintf_alloc("GetModuleFileName failed: %u (FormatMessage failed: %u)", + return g_strdup_printf("GetModuleFileName failed: %u (FormatMessage failed: %u)", error, GetLastError()); } msg = utf_16to8(msg_w); @@ -299,7 +300,7 @@ init_progfile_dir(const char *arg0 msg[msglen - 1] = '\0'; msg[msglen - 2] = '\0'; } - return g_sprintf_alloc("GetModuleFileName failed: %s (%u)", + return g_strdup_printf("GetModuleFileName failed: %s (%u)", msg, error); } #else -- cgit v1.2.3