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

Jonathon Jongsma jjongsma at redhat.com
Tue Mar 11 08:11:50 PDT 2014


ACK

----- Original Message -----
> From: "Marc-André Lureau" <marcandre.lureau at gmail.com>
> To: spice-devel at lists.freedesktop.org
> Sent: Tuesday, March 11, 2014 8:53:37 AM
> Subject: [Spice-devel] [PATCH spice-gtk] Silence some gcc warnings
> 
> 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
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
> 


More information about the Spice-devel mailing list