Re: [sleuthkit-users] fls simply reports usage information?
Brought to you by:
carrier
From: Seth A. <sa...@im...> - 2005-01-07 04:57:36
|
On Thu, Jan 06, 2005 at 09:41:57AM -0500, Brian Carrier wrote: > I just fixed that so that all 'usage' statements have an error. There Brian, thank you for your quick fix. It made it easy to find the bug. :) The problem is that getopt() will return a character in the normal case and a negative integer in the failure case. Because 'ch' was declared as a char, it does not have sufficient range to accept all character values _and_ the error return value -1. (This was made pretty clear when I modified your default: case to print the character: ÿ. I've learned to fear this character over the years.. it is 0xFF, 255, or (unsigned char) -1.) Thanks also for showing consistent discipline in your programs -- it was very easy to track down a few more programs that exhibit this error. Attached is a patch that will correct these errors. (Please forgive me my indulgence of re-indenting a handful of lines in the switch statement. I found the original a little difficult to read. If you'd rather keep the indenting the way it was, it should be easy to undo my changes by hand. :) Thanks for taking the time to help find the problem. Much appreciated. |