On 10/13/07, Durk Talsma <[EMAIL PROTECTED]> wrote:
>
> Okay thanks. Looking at the man page again, I found that my safeguarding
> code
> is also not yet foolproof. According to the man page: "If the return value
> is
> >= max, truncation has occurred". My safeguarding code only checks for >
> max
> though. Not a hard thing to fix though... :-)


One thing to be a little careful about when coding is that it's easy to be
tempted to check for the same error condition in multiple places or at
multiple levels of the function call stack.  That's not always optimal and
can lead to inconsistencies as the code ages, not to mention being a little
suboptimal.  I'm not advocating any hard and fast rules here, but it's easy
to become over paranoid and check result bounds way more than needed.

Curt.
-- 
Curtis Olson - University of Minnesota - FlightGear Project
http://baron.flightgear.org/~curt/  http://www.humanfirst.umn.edu/
http://www.flightgear.org
Unique text: 2f585eeea02e2c79d7b1d8c4963bae2d
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to