Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/games/sail temp is a pointer, and tempmax, not sizeof(temp), ...



details:   https://anonhg.NetBSD.org/src/rev/e3a097a7a7fd
branches:  trunk
changeset: 794905:e3a097a7a7fd
user:      apb <apb%NetBSD.org@localhost>
date:      Fri Mar 28 17:53:47 2014 +0000

description:
temp is a pointer, and tempmax, not sizeof(temp), is the length of
the buffer that it points to.  Adjust a strlcat() call to suit.

diffstat:

 games/sail/dr_2.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r b5aaa8f340d1 -r e3a097a7a7fd games/sail/dr_2.c
--- a/games/sail/dr_2.c Fri Mar 28 17:49:11 2014 +0000
+++ b/games/sail/dr_2.c Fri Mar 28 17:53:47 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dr_2.c,v 1.25 2009/03/14 22:52:52 dholland Exp $       */
+/*     $NetBSD: dr_2.c,v 1.26 2014/03/28 17:53:47 apb Exp $    */
 
 /*
  * Copyright (c) 1983, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)dr_2.c     8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: dr_2.c,v 1.25 2009/03/14 22:52:52 dholland Exp $");
+__RCSID("$NetBSD: dr_2.c,v 1.26 2014/03/28 17:53:47 apb Exp $");
 #endif
 #endif /* not lint */
 
@@ -286,7 +286,7 @@
        }
        if ((ma > 0 && ta > 0 && (n = str_end(temp)) != 'l' && n != 'r') ||
            !strlen(temp)) {
-               strlcat(temp, "l", sizeof(temp));
+               strlcat(temp, "l", tempmax);
                new = score(f, t, temp, tempmax, rakeme);
                if (new > *high && (!rakeme ||
                                    (gunsbear(f, t) && !gunsbear(t, f)))) {



Home | Main Index | Thread Index | Old Index