<div>Hi All,</div>
<div><br> Modified the code to avoid usage of _goto_.</div>
<div>Attached is the updated patch.</div>
<div> </div>
<div>regards,</div>
<div>Ashwini<br></div>
<div class="gmail_quote">On Tue, Aug 13, 2013 at 1:03 AM, Isaac <span dir="ltr"><<a href="mailto:ibid.ag@gmail.com" target="_blank">ibid.ag@gmail.com</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT:#ccc 1px solid;MARGIN:0px 0px 0px 0.8ex;PADDING-LEFT:1ex" class="gmail_quote">
<div class="HOEnZb">
<div class="h5">On Mon, Aug 12, 2013 at 06:29:25PM +0900, Ashwini Sharma wrote:<br>> Hi Rob,<br>><br>> In the continuation to DHCP client sent to you last week, attached here<br>> with is the DHCP server implementation.<br>
><br>> Have a look at the same and let me know for any comments.<br>><br>> regards,<br>> Ashwini<br><br></div></div>Note: these are my comments and not Rob's.<br><br>I note that not all of the uses of goto are neccessary.<br>
Here's an example of what I refer to:<br><br> if (buffer[0] == '#' || buffer[0] == '\n') goto free_buffer;<br> //parse buffer here<br>free_buffer:<br> free(buffer);<br><br>can readily become<br> if (buffer[0] != '#' && buffer[0] != '\n') {<br>
//parse buffer here<br> }<br> free(buffer);<br><br>Of course, for a buffer there's toybuf, which is not to be free()ed.<br><br>There will be places where you need to use goto if you don't check<br>3 different variables, but for cases where you aren't jumping out of<br>
a loop, the if () {} approach makes it much clearer that the code<br>is conditionally executed.<br><br>Thanks,<br>Isaac Dunham<br></blockquote></div><br>