[Spice-devel] [spice-server] sasl: Simplify red_stream_write_u32_le call with '0' serveroutlen

Christophe Fergeau cfergeau at redhat.com
Mon Jan 14 10:57:34 UTC 2019


Instead of
if (serveroutlen) {
...
} else {
    red_stream_write_u32_le(stream, serveroutlen);
}

use 'red_stream_write_u32_le(stream, 0);' in the else block as it's
slightly more obvious.

Signed-off-by: Christophe Fergeau <cfergeau at redhat.com>
---
 server/red-stream.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/server/red-stream.c b/server/red-stream.c
index fd5b8cd12..311387c25 100644
--- a/server/red-stream.c
+++ b/server/red-stream.c
@@ -903,7 +903,7 @@ static void red_sasl_handle_auth_step(void *opaque)
         red_stream_write_u32_le(stream, serveroutlen);
         red_stream_write_all(stream, serverout, serveroutlen);
     } else {
-        red_stream_write_u32_le(stream, serveroutlen);
+        red_stream_write_u32_le(stream, 0);
     }
 
     /* Whether auth is complete */
-- 
2.20.1



More information about the Spice-devel mailing list