Mercurial > octave-nkf
comparison test/test_io.m @ 12984:7626f8934466 stable
correctly resize scanf output for %c formats (bug #34037)
* oct-stream.cc (BEGIN_C_CONVERSION): Resize tmp buffer to number of
characters read.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 22 Aug 2011 20:27:27 -0400 |
parents | fd0a3ac60b0e |
children | 7872afb42fab |
comparison
equal
deleted
inserted
replaced
12983:9f3ddb1ff2e3 | 12984:7626f8934466 |
---|---|
239 %% test/octave.test/io/puts-3.m | 239 %% test/octave.test/io/puts-3.m |
240 %!error <Invalid call to puts.*> puts (); | 240 %!error <Invalid call to puts.*> puts (); |
241 | 241 |
242 %% test/octave.test/io/puts-4.m | 242 %% test/octave.test/io/puts-4.m |
243 %!error <Invalid call to puts.*> puts (1, 2); | 243 %!error <Invalid call to puts.*> puts (1, 2); |
244 | |
245 %!assert (sscanf ('123456', '%10c'), '123456') | |
246 %!assert (sscanf ('123456', '%10s'), '123456') | |
244 | 247 |
245 %% test/octave.test/io/sscanf-1.m | 248 %% test/octave.test/io/sscanf-1.m |
246 %!test | 249 %!test |
247 %! [a, b, c] = sscanf ("1.2 3 foo", "%f%d%s", "C"); | 250 %! [a, b, c] = sscanf ("1.2 3 foo", "%f%d%s", "C"); |
248 %! [v1, c1, m1] = sscanf ("1 2 3 4 5 6", "%d"); | 251 %! [v1, c1, m1] = sscanf ("1 2 3 4 5 6", "%d"); |