Mercurial > octave
changeset 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 | dc6404ab6947 |
children | ea1253f05dd3 |
files | libinterp/corefcn/oct-stream.cc |
diffstat | 1 files changed, 2 insertions(+), 1 deletions(-) [+] |
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++]); \ } \ } \ } \