Mercurial > octave
diff libinterp/corefcn/oct-stream.cc @ 26566:f8d380d04b01 stable
Fix dead assignments found by clang static analysis (bug #55440).
* find.cc (Ffind): Delete "direction = 0;" assignment.
* oct-map.cc (octave_fields::equal_up_to_order): Declare, but don't bother to
initialize retval. If mismatch is found, return false directly to jump
out of loop.
* oct-stream.cc (printf_format_list::printf_format_list): Delete
"empty_buf = false;"
* oct-stream.cc (textscan::scan_complex): delete unnecessary call to
is.tellg () to get pos which is never used.
* regexp.cc (do_regexp_ptn_string_escapes): Delete "bad_esc_seq = true;".
* ov-java.cc (unbox): Delete "found = false;".
author | Rik <rik@octave.org> |
---|---|
date | Thu, 17 Jan 2019 08:04:53 -0800 |
parents | d76f9e42290a |
children | c18e59476795 |
line wrap: on
line diff
--- a/libinterp/corefcn/oct-stream.cc Wed Jan 16 20:32:15 2019 -0800 +++ b/libinterp/corefcn/oct-stream.cc Thu Jan 17 08:04:53 2019 -0800 @@ -914,7 +914,6 @@ modifier = '\0'; type = '\0'; buf << s[i++]; - empty_buf = false; } break; } @@ -2993,8 +2992,8 @@ if (! is.eof () && ! as_empty) { - state = is.rdstate (); // before tellg, since that fails at EOF - pos = is.tellg (); + state = is.rdstate (); // before tellg, since that fails at EOF + ch = is.peek (); // ch == EOF if read failed; no need to chk fail if (ch == 'i' || ch == 'j') // pure imaginary {