summaryrefslogtreecommitdiff
path: root/src/gui/gui-buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/gui-buffer.c')
-rw-r--r--src/gui/gui-buffer.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/gui-buffer.c b/src/gui/gui-buffer.c
index 5a0d0c861..d85f06aff 100644
--- a/src/gui/gui-buffer.c
+++ b/src/gui/gui-buffer.c
@@ -537,7 +537,8 @@ gui_buffer_input_buffer_init (struct t_gui_buffer *buffer)
{
buffer->input_buffer_alloc = GUI_BUFFER_INPUT_BLOCK_SIZE;
buffer->input_buffer = malloc (GUI_BUFFER_INPUT_BLOCK_SIZE);
- buffer->input_buffer[0] = '\0';
+ if (buffer->input_buffer)
+ buffer->input_buffer[0] = '\0';
buffer->input_buffer_size = 0;
buffer->input_buffer_length = 0;
buffer->input_buffer_pos = 0;