On Mon, Aug 12, 2013 at 06:29:25PM +0900, Ashwini Sharma wrote: > Hi Rob, > > In the continuation to DHCP client sent to you last week, attached here > with is the DHCP server implementation. > > Have a look at the same and let me know for any comments. > > regards, > Ashwini
Note: these are my comments and not Rob's. I note that not all of the uses of goto are neccessary. Here's an example of what I refer to: if (buffer[0] == '#' || buffer[0] == '\n') goto free_buffer; //parse buffer here free_buffer: free(buffer); can readily become if (buffer[0] != '#' && buffer[0] != '\n') { //parse buffer here } free(buffer); Of course, for a buffer there's toybuf, which is not to be free()ed. There will be places where you need to use goto if you don't check 3 different variables, but for cases where you aren't jumping out of a loop, the if () {} approach makes it much clearer that the code is conditionally executed. Thanks, Isaac Dunham _______________________________________________ Toybox mailing list Toybox@lists.landley.net http://lists.landley.net/listinfo.cgi/toybox-landley.net