=================================================================== RCS file: /cvs/mandoc/roff.c,v retrieving revision 1.72 retrieving revision 1.73 diff -u -p -r1.72 -r1.73 --- mandoc/roff.c 2010/05/15 22:22:51 1.72 +++ mandoc/roff.c 2010/05/15 22:28:22 1.73 @@ -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 * @@ -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); }