Used a couple "#if SUBPROTOCOL_VERSION != 0" conditionals.
authorWayne Davison <wayned@samba.org>
Sun, 9 Sep 2007 07:52:59 +0000 (07:52 +0000)
committerWayne Davison <wayned@samba.org>
Sun, 9 Sep 2007 07:52:59 +0000 (07:52 +0000)
compat.c

index aa32de8..fb00274 100644 (file)
--- a/compat.c
+++ b/compat.c
@@ -67,13 +67,19 @@ static void check_sub_protocol(void)
 {
        char *dot;
        int their_protocol, their_sub;
+#if SUBPROTOCOL_VERSION != 0
        int our_sub = protocol_version < PROTOCOL_VERSION ? 0 : SUBPROTOCOL_VERSION;
+#else
+       int our_sub = 0;
+#endif
 
        if (!shell_cmd || !(dot = strchr(shell_cmd, '.'))
         || !(their_protocol = atoi(shell_cmd))
         || !(their_sub = atoi(dot+1))) {
+#if SUBPROTOCOL_VERSION != 0
                if (our_sub)
                        protocol_version--;
+#endif
                return;
        }
 
@@ -84,7 +90,7 @@ static void check_sub_protocol(void)
        }
 
        if (their_protocol > protocol_version)
-               their_sub = 0; /* 0 == final version */
+               their_sub = 0; /* 0 == final version of older protocol */
        if (their_sub != our_sub)
                protocol_version--;
 }