diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2016-03-03 18:49:12 -0800 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2016-03-03 18:49:24 -0800 |
commit | 1e7c3fe70964711918bcf13553ae9fb66ed73a17 (patch) | |
tree | 99541c6a121f0868834f1cceb35c36092515cc6c /src/builtin.cpp | |
parent | 333415f42a8fb837b4867edda7118cd50d59a485 (diff) |
A few fixes suggested by Coverity Scan
Diffstat (limited to 'src/builtin.cpp')
-rw-r--r-- | src/builtin.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/builtin.cpp b/src/builtin.cpp index b83bb82a..4597b18e 100644 --- a/src/builtin.cpp +++ b/src/builtin.cpp @@ -3305,15 +3305,16 @@ static int builtin_contains(parser_t &parser, io_streams_t &streams, wchar_t ** { streams.err.append_format(_(L"%ls: Key not specified\n"), argv[0]); } - - - for (int i=w.woptind+1; i<argc; i++) + else { - - if (!wcscmp(needle, argv[i])) + for (int i=w.woptind+1; i<argc; i++) { - if (should_output_index) streams.out.append_format( L"%d\n", i-w.woptind); - return 0; + + if (!wcscmp(needle, argv[i])) + { + if (should_output_index) streams.out.append_format( L"%d\n", i-w.woptind); + return 0; + } } } return 1; |