diff options
Diffstat (limited to 'src/mainwindow.c')
-rw-r--r-- | src/mainwindow.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mainwindow.c b/src/mainwindow.c index b152bd0..578640d 100644 --- a/src/mainwindow.c +++ b/src/mainwindow.c @@ -989,12 +989,12 @@ static void insert_text(struct frame *fr, char *t, struct presentation *p) if ( tlen + olen + 1 > fr->sc_len ) { char *try; + size_t new_len = fr->sc_len + tlen + 64; - try = realloc(fr->sc, fr->sc_len + tlen + 64); + try = realloc(fr->sc, new_len); if ( try == NULL ) return; /* Failed to insert */ fr->sc = try; - fr->sc_len += 64; - fr->sc_len += tlen; + fr->sc_len = new_len; } |