[Spice-commits] server/reds.c

Frediano Ziglio fziglio at kemper.freedesktop.org
Wed Mar 8 10:50:50 UTC 2017


 server/reds.c |   13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

New commits:
commit 9bcfba3c6875ec0204f00a93baf69af1307f09f5
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Tue Mar 7 13:59:53 2017 +0000

    reds: Change if style
    
    The nested if statements could be confusing, no needs for them.
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Victor Toso <victortoso at redhat.com>

diff --git a/server/reds.c b/server/reds.c
index 41f24bb..2ad231e 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -2012,12 +2012,13 @@ static void reds_handle_ticket(void *opaque)
             goto error;
         }
 
-        if (expired || strcmp(password, reds->config->taTicket.password) != 0) {
-            if (expired) {
-                spice_warning("Ticket has expired");
-            } else {
-                spice_warning("Invalid password");
-            }
+        if (expired) {
+            spice_warning("Ticket has expired");
+            goto error;
+        }
+
+        if (strcmp(password, reds->config->taTicket.password) != 0) {
+            spice_warning("Invalid password");
             goto error;
         }
     }


More information about the Spice-commits mailing list