[Chilli] [Patch] Fix auth state in redir_main()

IT-Systemmanagement Pieter Hollants pieter at hollants.com
Sat May 22 16:58:15 UTC 2010


Am 22.05.2010 07:12, schrieb David Bird:
> Thanks, though, there isn't really any harm in reusing the variable
> since it's never part of any conditional. It amounts to:
> 
>   int state = 0; /* initialization not really needed */
> 
>   state = func();
>   if (state) /* something */
> 
>   state = func();
>   switch(state) /* something */
> 
> Thanks,
> David

Uhm, yes it is, because the switch depends on the outcome of the first
function call, redir->cb_getstate(), which returns 0 for unauth'ed, 1
for auth'ed, not the second function call, redir_getreq.

-- 
Dipl.-Wirtsch.-Inform. Pieter Hollants
IT-Systemmanagement Pieter Hollants          Tel. : (+49) (0)6192-910717
Rossertstraße 80                             Fax  : (+49) (0)6192-910713
65830 Kriftel                                eMail: pieter at hollants.com



More information about the Chilli mailing list