Mercurial > hg > octave-lyh
changeset 10853:c3813056f94f
mxArray_number (const char *): create empty string if given NULL arg
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 04 Aug 2010 19:44:27 -0400 |
parents | 47e013327758 |
children | d5a7db05d591 |
files | src/ChangeLog src/mex.cc |
diffstat | 2 files changed, 9 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2010-08-04 John W. Eaton <jwe@octave.org> + + * mex.cc (mxArray_number (const char *)): Create empty string if + given NULL arg (bug #30639). Create 0x0 string array if given + an empty string argument, not 1x0. + 2010-08-03 Jaroslav Hajek <highegg@gmail.com> * OPERATORS/op-str-str.cc: Fix assignment operator.
--- a/src/mex.cc +++ b/src/mex.cc @@ -1131,7 +1131,9 @@ } mxArray_number (const char *str) - : mxArray_matlab (mxCHAR_CLASS, 1, strlen (str)), + : mxArray_matlab (mxCHAR_CLASS, + str ? (strlen (str) ? 1 : 0) : 0, + str ? strlen (str) : 0), pr (calloc (get_number_of_elements (), get_element_size ())), pi (0) {