diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-03-15 16:23:51 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-03-15 16:23:51 +0000 |
commit | 3572d7e4773e34f2d039d1436af1c91795887f04 (patch) | |
tree | df3354c5fd7a8a37527b23a9d8ec160a39fe37c8 /tbl_data.c | |
parent | ef0353dfc9e7fa3b8dd811c3b71e0e3af38aa552 (diff) | |
download | mandoc-3572d7e4773e34f2d039d1436af1c91795887f04.tar.gz mandoc-3572d7e4773e34f2d039d1436af1c91795887f04.tar.zst mandoc-3572d7e4773e34f2d039d1436af1c91795887f04.zip |
Make lint shut up a little bit.
Diffstat (limited to 'tbl_data.c')
-rw-r--r-- | tbl_data.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -1,4 +1,4 @@ -/* $Id: tbl_data.c,v 1.22 2011/02/06 22:02:58 kristaps Exp $ */ +/* $Id: tbl_data.c,v 1.23 2011/03/15 16:23:51 kristaps Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2011 Ingo Schwarze <schwarze@openbsd.org> @@ -106,8 +106,10 @@ data(struct tbl_node *tbl, struct tbl_span *dp, return(0); } - dat->string = mandoc_malloc(*pos - sv + 1); - memcpy(dat->string, &p[sv], *pos - sv); + assert(*pos - sv >= 0); + + dat->string = mandoc_malloc((size_t)(*pos - sv + 1)); + memcpy(dat->string, &p[sv], (size_t)(*pos - sv)); dat->string[*pos - sv] = '\0'; if (p[*pos]) |