mirror of
https://github.com/irssi/irssi.git
synced 2026-08-19 16:42:30 +02:00
Text buffer: Saving pointer to char[] didn't work correctly with
netbsd/alpha which caused crash soon after startup. Changed the code a bit, I'm not sure if it's still correct ANSI C but at least it seems to work fine with netbsd/alpha now :) git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1397 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
db7c60b9a5
commit
9e1cbb2637
1 changed files with 3 additions and 3 deletions
|
|
@ -81,7 +81,7 @@ static LINE_REC *create_line(GUI_WINDOW_REC *gui, int level)
|
||||||
static TEXT_CHUNK_REC *create_text_chunk(GUI_WINDOW_REC *gui)
|
static TEXT_CHUNK_REC *create_text_chunk(GUI_WINDOW_REC *gui)
|
||||||
{
|
{
|
||||||
TEXT_CHUNK_REC *rec;
|
TEXT_CHUNK_REC *rec;
|
||||||
char *buffer, *ptr;
|
char *buffer, *ptr, **pptr;
|
||||||
|
|
||||||
g_return_val_if_fail(gui != NULL, NULL);
|
g_return_val_if_fail(gui != NULL, NULL);
|
||||||
|
|
||||||
|
|
@ -94,8 +94,8 @@ static TEXT_CHUNK_REC *create_text_chunk(GUI_WINDOW_REC *gui)
|
||||||
buffer = gui->cur_text->buffer + gui->cur_text->pos;
|
buffer = gui->cur_text->buffer + gui->cur_text->pos;
|
||||||
*buffer++ = 0; *buffer++ = (char) LINE_CMD_CONTINUE;
|
*buffer++ = 0; *buffer++ = (char) LINE_CMD_CONTINUE;
|
||||||
|
|
||||||
ptr = rec->buffer;
|
ptr = rec->buffer; pptr = &ptr;
|
||||||
memcpy(buffer, &ptr, sizeof(char *));
|
memcpy(buffer, pptr, sizeof(char *));
|
||||||
} else {
|
} else {
|
||||||
/* just to be safe */
|
/* just to be safe */
|
||||||
mark_temp_eol(rec);
|
mark_temp_eol(rec);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue