]> git.street.me.uk Git - andy/viking.git/blobdiff - src/util.c
Fix Resource leak detected by cppcheck 1.46
[andy/viking.git] / src / util.c
index 975fce06f1a0be8a8395a321ff1c8067fe74c413..fefef829c11f750bd200216a85b462d08c20705b 100644 (file)
@@ -1,8 +1,8 @@
 /*
  *    Viking - GPS data editor
- *    Copyright (C) 2007 Guilhem Bonnefille <guilhem.bonnefille@gmail.com>
+ *    Copyright (C) 2007, Guilhem Bonnefille <guilhem.bonnefille@gmail.com>
  *    Based on:
- *    Copyright (C) 2003-2007 Leandro A. F. Pereira <leandro@linuxmag.com.br>
+ *    Copyright (C) 2003-2007, Leandro A. F. Pereira <leandro@linuxmag.com.br>
  *
  *    This program is free software; you can redistribute it and/or modify
  *    it under the terms of the GNU General Public License as published by
@@ -26,7 +26,9 @@
 #endif
 
 #include <glib/gi18n.h>
+#include <glib/gprintf.h>
 
+#include "util.h"
 #include "dialog.h"
 
 static gboolean spawn_command_line_async(const gchar * cmd,
@@ -101,7 +103,7 @@ gchar *uri_escape(gchar *str)
     else if (g_ascii_isalnum(*src))
      *dst++ = *src;
     else {
-      g_sprintf(dst, "%%%02X", *src);
+      g_sprintf(dst, "%%%02hhX", *src);
       dst += 3;
     }
   }