diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2003-03-18 16:55:55 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2003-03-18 16:55:55 +0000 |
commit | dfbb771c83664afc246a3834d4ec17f3169b5989 (patch) | |
tree | a6062cdd0136c3b4f82635b600a22a9bb6099569 /lib/libcurses/tinfo/comp_parse.c | |
parent | 9504d3161dd42533b38ffc7e455b079baddb6032 (diff) |
Use strlcpy() / strlcat() throughout.
Diffstat (limited to 'lib/libcurses/tinfo/comp_parse.c')
-rw-r--r-- | lib/libcurses/tinfo/comp_parse.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/libcurses/tinfo/comp_parse.c b/lib/libcurses/tinfo/comp_parse.c index 7a8992726ac..4c9b83497d3 100644 --- a/lib/libcurses/tinfo/comp_parse.c +++ b/lib/libcurses/tinfo/comp_parse.c @@ -1,4 +1,4 @@ -/* $OpenBSD: comp_parse.c,v 1.10 2001/01/22 18:01:51 millert Exp $ */ +/* $OpenBSD: comp_parse.c,v 1.11 2003/03/18 16:55:54 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * @@ -132,9 +132,10 @@ force_bar(char *dst, char *src, size_t siz) size_t len; len = strlcpy(dst, src, siz); - if (len >= siz - 2) - len = siz - 2;; - (void) strcpy(dst + len, "|"); + if (len > siz - 2) + len = siz - 2; + dst[len++] = '|'; + dst[len] = '\0'; src = dst; } return src; |