[Spice-devel] [PATCH spice-gtk] Silence some gcc warnings

Marc-André Lureau marcandre.lureau at gmail.com
Tue Mar 11 06:53:37 PDT 2014


cc1: warnings being treated as errors
spice-uri.c: In function ‘spice_uri_parse’:
spice-uri.c:105: error: ‘saveptr’ may be used uninitialized in this
function [-Wuninitialized]
spice-uri.c:105: error: ‘saveptr2’ may be used uninitialized in this
function [-Wuninitialized]
---
 gtk/spice-uri.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gtk/spice-uri.c b/gtk/spice-uri.c
index 03b8c22..5180b74 100644
--- a/gtk/spice-uri.c
+++ b/gtk/spice-uri.c
@@ -102,7 +102,7 @@ gboolean spice_uri_parse(SpiceURI *self, const gchar *_uri, GError **error)
 
     /* yes, that parser is bad, we need GUri... */
     if (strstr(uri, "@")) {
-        gchar *saveptr, *saveptr2;
+        gchar *saveptr = NULL, *saveptr2 = NULL;
         gchar *next = strstr(uri, "@") + 1;
         gchar *auth = strtok_r(uri, "@", &saveptr);
         const gchar *user = strtok_r(auth, ":", &saveptr2);
-- 
1.8.5.3



More information about the Spice-devel mailing list