Re: bash-4.2: poor order of conditionals

2011-10-26 Thread Chet Ramey
On 10/25/11 4:54 PM, David Binderman wrote: > > > Hello there, > > I just ran the static analysis tool cppcheck over the source > code of bash-4.2 > > It said > > [bash-4.2/builtins/mkbuiltins.c:554]: (style) Array index i is used before > limits check > > The source code is > > while

bash-4.2: poor order of conditionals

2011-10-26 Thread David Binderman
Hello there, I just ran the static analysis tool cppcheck over the source code of bash-4.2 It said [bash-4.2/builtins/mkbuiltins.c:554]: (style) Array index i is used before limits check The source code is while (buffer[i] != '\n' && i < file_size) i++; You might be better of