[Dnsmasq-discuss] goto's to the middle of if's in tftp.c...
simon at thekelleys.org.uk
Thu Feb 1 16:51:43 GMT 2007
Carlos Carvalho wrote:
> There are some goto's to the middle of if's and else's in tftp.c. Such
> jumps could perhaps be changed to a place less susceptible to
> confusion... Since it's a new piece of code it might still be open to
> small revisions. It may cost some extra if's but it won't make a
> difference in performance.
If anyone can come up with a nicer solution, I'd be happy to take it,
but I think that's a good use for gotos. The code identifies a couple of
error conditions and the way to handle them, so it's obvious what's
going on. When the same error conditions are encountered later, they are
handled by gotos to the previously defined error handling code - it's a
standard programming practise.
More information about the Dnsmasq-discuss