Mercurial > hg > octave-lyh > gnulib-hg
changeset 13466:00760b212392
striconveh: Simplify last commit.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Tue, 13 Jul 2010 23:43:14 +0200 |
parents | dc342fd2f695 |
children | b3e78c51aab6 |
files | lib/striconveh.c |
diffstat | 1 files changed, 3 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/lib/striconveh.c +++ b/lib/striconveh.c @@ -972,26 +972,21 @@ size_t memsize = length + extra_alloc; if (*resultp != NULL && *lengthp >= memsize) - { - result = *resultp; - memcpy (result, tmpbuf, length); - } + result = *resultp; else { char *memory; memory = (char *) malloc (memsize > 0 ? memsize : 1); if (memory != NULL) - { - memcpy (memory, tmpbuf, length); - result = memory; - } + result = memory; else { errno = ENOMEM; return -1; } } + memcpy (result, tmpbuf, length); } else if (result != *resultp && length + extra_alloc < allocated) {