Mercurial > octave
diff libinterp/corefcn/oct-stream.cc @ 24496:62a7d3f292d6 stable
Correctly handle reading of characters >127 in scanf family (bug #52681).
* oct-stream.cc (FINISH_CHARACTER_CONVERSION): Cast "char" to "unsigned char"
before assigning to "double".
author | Markus Mützel <markus.muetzel@gmx.de> |
---|---|
date | Thu, 21 Dec 2017 20:25:53 +0100 |
parents | ddc91a2ee0e0 |
children | 9c178e5252e4 |
line wrap: on
line diff
--- a/libinterp/corefcn/oct-stream.cc Fri Dec 29 08:41:20 2017 -0800 +++ b/libinterp/corefcn/oct-stream.cc Thu Dec 21 20:25:53 2017 +0100 @@ -4592,7 +4592,8 @@ data = mval.fortran_vec (); \ } \ \ - data[data_index++] = tmp[i++]; \ + data[data_index++] = static_cast<unsigned char> \ + (tmp[i++]); \ } \ } \ } \