diff options
author | Anil Madhavapeddy <avsm@cvs.openbsd.org> | 2003-07-06 02:04:04 +0000 |
---|---|---|
committer | Anil Madhavapeddy <avsm@cvs.openbsd.org> | 2003-07-06 02:04:04 +0000 |
commit | 9e3628d296cdd659839a7b772c967f101c2d6efd (patch) | |
tree | 5918812e31bdc3af8d35ab41ec1fbddc44f733d8 /games/quiz | |
parent | 257014cfb2816ded025cae21bad2effde5f7916d (diff) |
add a comment that an strncpy should not be converted to an strlcpy;
noted by pjanzen@
Diffstat (limited to 'games/quiz')
-rw-r--r-- | games/quiz/quiz.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/games/quiz/quiz.c b/games/quiz/quiz.c index 28522a67339..3bd7d79ae72 100644 --- a/games/quiz/quiz.c +++ b/games/quiz/quiz.c @@ -1,4 +1,4 @@ -/* $OpenBSD: quiz.c,v 1.14 2003/06/03 03:01:40 millert Exp $ */ +/* $OpenBSD: quiz.c,v 1.15 2003/07/06 02:04:03 avsm Exp $ */ /* $NetBSD: quiz.c,v 1.9 1995/04/22 10:16:58 cgd Exp $ */ /*- @@ -44,7 +44,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)quiz.c 8.3 (Berkeley) 5/4/95"; #else -static char rcsid[] = "$OpenBSD: quiz.c,v 1.14 2003/06/03 03:01:40 millert Exp $"; +static char rcsid[] = "$OpenBSD: quiz.c,v 1.15 2003/07/06 02:04:03 avsm Exp $"; #endif #endif /* not lint */ @@ -144,6 +144,7 @@ get_file(file) qp = qp->q_next; if ((qp->q_text = malloc(len + 1)) == NULL) errx(1, "malloc"); + /* lp may not be zero-terminated; cannot use strlcpy */ strncpy(qp->q_text, lp, len); qp->q_text[len] = '\0'; qp->q_asked = qp->q_answered = FALSE; |