Avoid setting unused variables (-Wself-assign)

Setting a variable and then assigning it to itself avoids
-Wunused-but-set-variable but this specific trick is now caught by
-Wself-assign. Instead, actually use the value or don't bother
assigning it at all:

gdbusauth.c: call g_data_input_stream_read_byte() in void context
gdbusauthmechanismsha1.c: value is actually used
gdbusmessage.c: use consistent preprocessor-token protection
gthreadedresolver.c: skip over bytes in data blob
httpd.c: do something useful with the value

https://bugzilla.gnome.org/show_bug.cgi?id=745723
This commit is contained in:
Daniel Macks
2015-03-19 23:06:28 -04:00
committed by Philip Withnall
parent 5d9ccf162e
commit 190f64a0fb
5 changed files with 23 additions and 20 deletions

View File

@@ -67,12 +67,19 @@ handler (GThreadedSocketService *service,
version = NULL;
tmp = strchr (escaped, ' ');
if (tmp != NULL)
if (tmp == NULL)
{
*tmp = 0;
version = tmp + 1;
send_error (out, 400, "Bad Request");
goto out;
}
*tmp = 0;
version = tmp + 1;
if (!g_str_has_prefix (version, "HTTP/1."))
{
send_error(out, 505, "HTTP Version Not Supported");
goto out;
}
version = version; /* To avoid -Wunused-but-set-variable */
query = strchr (escaped, '?');
if (query != NULL)