diff options
author | Emanuele Giaquinta <exg@irssi.org> | 2006-09-24 21:43:12 +0000 |
---|---|---|
committer | exg <exg@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2006-09-24 21:43:12 +0000 |
commit | 746649ae774451ad28adfebe7be0ef4d9435243b (patch) | |
tree | 6ae93d67c2615b8ba3acec42a0de273729414469 /src/core/line-split.c | |
parent | da9582e5aabd2c4e1588c166012fbfec7b0b31e7 (diff) | |
download | irssi-746649ae774451ad28adfebe7be0ef4d9435243b.zip |
In line_split set *output _after_ calling remove_newline because it
could reallocate rec->str, fixes bug #439.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4381 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/core/line-split.c')
-rw-r--r-- | src/core/line-split.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/line-split.c b/src/core/line-split.c index b7daf275..a1e96544 100644 --- a/src/core/line-split.c +++ b/src/core/line-split.c @@ -90,6 +90,7 @@ static int remove_newline(LINEBUF_REC *rec) int line_split(const char *data, int len, char **output, LINEBUF_REC **buffer) { LINEBUF_REC *rec; + int ret; g_return_val_if_fail(data != NULL, -1); g_return_val_if_fail(output != NULL, -1); @@ -122,8 +123,9 @@ int line_split(const char *data, int len, char **output, LINEBUF_REC **buffer) } } + ret = remove_newline(rec); *output = rec->str; - return remove_newline(rec); + return ret; } void line_split_free(LINEBUF_REC *buffer) |