Mercurial > octave-libtiff
changeset 11569:7e9a111cae20
allocate sufficient space for strmode
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 19 Jan 2011 15:12:59 -0500 |
parents | de5fba8337c5 |
children | 57632dea2446 |
files | liboctave/ChangeLog liboctave/file-stat.cc |
diffstat | 2 files changed, 7 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/ChangeLog Wed Jan 19 05:42:37 2011 -0500 +++ b/liboctave/ChangeLog Wed Jan 19 15:12:59 2011 -0500 @@ -1,3 +1,9 @@ +2011-01-19 John W. Eaton <jwe@octave.org> + + * file-stat.cc (mode_as_string): Declare buffer as an array of + 12 characters, not 11. Don't set buf[10] to '\0'; strmode + NUL-terminates the array. + 2011-01-14 David Grundberg <individ@acc.umu.se> * SparseQR.cc (SparseQR_rep::SparseQR_rep) [HAVE_CXSPARSE]:
--- a/liboctave/file-stat.cc Wed Jan 19 05:42:37 2011 -0500 +++ b/liboctave/file-stat.cc Wed Jan 19 15:12:59 2011 -0500 @@ -155,12 +155,10 @@ std::string base_file_stat::mode_as_string (void) const { - char buf[11]; + char buf[12]; strmode (fs_mode, buf); - buf[10] = '\0'; - return std::string (buf); }