Author: abartlet
Date: 2004-11-05 12:52:09 +0000 (Fri, 05 Nov 2004)
New Revision: 3557

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=3557

Log:
Use a switch, not a series of if/else if statements.

Andrew Bartlett

Modified:
   branches/SAMBA_4_0/source/torture/rpc/netlogon.c


Changeset:
Modified: branches/SAMBA_4_0/source/torture/rpc/netlogon.c
===================================================================
--- branches/SAMBA_4_0/source/torture/rpc/netlogon.c    2004-11-05 12:48:22 UTC (rev 
3556)
+++ branches/SAMBA_4_0/source/torture/rpc/netlogon.c    2004-11-05 12:52:09 UTC (rev 
3557)
@@ -280,6 +280,7 @@
        struct netr_LogonSamLogon r;
        struct netr_Authenticator auth, auth2;
        struct creds_CredentialState creds;
+
        DATA_BLOB chall;
 };
 
@@ -374,14 +375,16 @@
        }
                
        /* find and decyrpt the session keys, return in parameters above */
-       if (r->in.validation_level == 2) {
-               base = &r->out.validation.sam2->base;
-       } else if (r->in.validation_level == 3) {
-               base = &r->out.validation.sam3->base;
-       } else if (r->in.validation_level == 6) {
-               base = &r->out.validation.sam6->base;
-       } else {
-               base = NULL;
+       switch (r->in.validation_level) {
+               case 2:
+                       base = &r->out.validation.sam2->base;
+               break;
+               case 3:
+                       base = &r->out.validation.sam3->base;
+               break;
+               case 6:
+                       base = &r->out.validation.sam6->base;
+               break;
        }
 
        if (r->in.validation_level != 6) {

Reply via email to