Mercurial > octave-nkf
changeset 19904:60fe3ef12bb0
Correct test for string-not-found, avoid substr crash in drawnow() (bug #44292)
* graphics.cc (drawnow): Use proper check for a size_t value being not-found,
rather than treating as signed number.
author | Daniel J Sebald <daniel.sebald@ieee.org> |
---|---|
date | Thu, 26 Feb 2015 18:57:58 -0600 |
parents | c7c50030e76c |
children | 815db217f6f4 |
files | libinterp/corefcn/graphics.cc |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/corefcn/graphics.cc Fri Feb 27 09:44:58 2015 -0500 +++ b/libinterp/corefcn/graphics.cc Thu Feb 26 18:57:58 2015 -0600 @@ -11070,7 +11070,7 @@ if (! error_state) { size_t pos = file.find_first_not_of ("|"); - if (pos > 0) + if (pos != std::string::npos) file = file.substr (pos); else {