No matter..this is the right way to check if a pointer is null in C. http://stackoverflow.com/questions/7970617/how-can-i-check-if-char-variable-...
On Tuesday, February 5, 2013, Arthur Mesh wrote:
On Tue, Feb 05, 2013 at 05:25:59AM -0500, Brian Wilkins wrote:
Checking if errstr is null
On Mon, Feb 04, 2013 at 02:48:36PM -0500, Brian Wilkins wrote:
Looks like a false positive..checking if a char array is null in that manner is a well known convention.
Actually, I disagree. errstr is a pointer to a character, not a character array.
If you take a closer look, you'll see that errstr is initialized conditionally. Whereas its value is checked unconditionally. Now, if you're implying that there is no way it's never initialized before its value is checked, then fine. Otherwise, it seems like a bug.
Thanks