1
0
mirror of https://github.com/irssi/irssi.git synced 2024-09-29 04:45:57 -04:00

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
This commit is contained in:
Emanuele Giaquinta 2006-09-24 21:43:12 +00:00 committed by exg
parent da9582e5aa
commit 746649ae77

View File

@ -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)