diff options
Diffstat (limited to 'roff.c')
-rw-r--r-- | roff.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1,4 +1,4 @@ -/* $Id: roff.c,v 1.72 2010/05/15 22:22:51 kristaps Exp $ */ +/* $Id: roff.c,v 1.73 2010/05/15 22:28:22 kristaps Exp $ */ /* * Copyright (c) 2010 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -349,14 +349,14 @@ roff_new_ig(ROFF_ARGS) * Merry fucking Christmas. */ - r->last->end = malloc((size_t)i - ppos + 1); + r->last->end = malloc((size_t)(i - ppos) + 1); if (NULL == r->last->end) { (*r->msg)(MANDOCERR_MEM, r->data, ln, ppos, NULL); return(ROFF_ERR); } - memcpy(r->last->end, &(*bufp)[ppos], (size_t)i - ppos); - r->last->end[(size_t)i - ppos] = '\0'; + memcpy(r->last->end, &(*bufp)[ppos], (size_t)(i - ppos)); + r->last->end[i - ppos] = '\0'; return(ROFF_IGN); } |