Mercurial > hg > octave-nkf
diff src/variables.cc @ 10640:5c594472f75e
determine string enum length by trailing null rather than sizeof
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Tue, 18 May 2010 08:34:02 +0200 |
parents | e1559a8a60b4 |
children | 89f4d7e294cc |
line wrap: on
line diff
--- a/src/variables.cc +++ b/src/variables.cc @@ -873,10 +873,12 @@ octave_value set_internal_variable (int& var, const octave_value_list& args, - int nargout, const char *nm, const char **choices, - int nchoices) + int nargout, const char *nm, const char **choices) { octave_value retval; + int nchoices = 0; + while (choices[nchoices] != 0) + nchoices++; int nargin = args.length (); assert (var < nchoices);