Mercurial > hg > octave-lojdl
changeset 1900:a3132152a41f
[project @ 1996-02-09 17:56:33 by jwe]
author | jwe |
---|---|
date | Fri, 09 Feb 1996 17:56:33 +0000 |
parents | 2f19333b1e72 |
children | 527af71a8035 |
files | src/input.cc |
diffstat | 1 files changed, 4 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/input.cc +++ b/src/input.cc @@ -403,13 +403,11 @@ { char *tmp = retval = ::readline (s); - if (tmp) + if (tmp && strlen (tmp) == 0) { - int len = strlen (tmp); - retval = (char *) malloc (len + 2); - strcpy (retval, tmp); - retval[len] = '\n'; - retval[len+1] = '\0'; + retval = (char *) malloc (2); + retval[0] = '\n'; + retval[1] = '\0'; } } else