Source-Changes-HG archive

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

[src/trunk]: src/games/hunt/hunt curses has printw, use it.



details:   https://anonhg.NetBSD.org/src/rev/5d0b0cc7c1ac
branches:  trunk
changeset: 328290:5d0b0cc7c1ac
user:      dholland <dholland%NetBSD.org@localhost>
date:      Sun Mar 30 05:46:54 2014 +0000

description:
curses has printw, use it.

diffstat:

 games/hunt/hunt/hunt.c |  11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)

diffs (39 lines):

diff -r 4a22505603cd -r 5d0b0cc7c1ac games/hunt/hunt/hunt.c
--- a/games/hunt/hunt/hunt.c    Sun Mar 30 05:44:55 2014 +0000
+++ b/games/hunt/hunt/hunt.c    Sun Mar 30 05:46:54 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hunt.c,v 1.56 2014/03/30 05:44:55 dholland Exp $       */
+/*     $NetBSD: hunt.c,v 1.57 2014/03/30 05:46:54 dholland Exp $       */
 /*
  * Copyright (c) 1983-2003, Regents of the University of California.
  * All rights reserved.
@@ -32,7 +32,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: hunt.c,v 1.56 2014/03/30 05:44:55 dholland Exp $");
+__RCSID("$NetBSD: hunt.c,v 1.57 2014/03/30 05:46:54 dholland Exp $");
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -376,7 +376,6 @@
        socklen_t hostlen;
        unsigned num;
        int i, c;
-       char buf[128];
 
        msg = C_PLAYER;
 #ifdef MONITOR
@@ -408,10 +407,8 @@
                for (i = 0; i < HEIGHT - 4 && i < (int)num; i++) {
                        move(3 + i, 0);
                        host = serverlist_gethost(i, &hostlen);
-                       (void) snprintf(buf, sizeof(buf),
-                                       "%8c    %.64s", 'a' + i,
-                                       lookuphost(host, hostlen));
-                       addstr(buf);
+                       printw("%8c    %.64s", 'a' + i,
+                              lookuphost(host, hostlen));
                }
                move(4 + i, 0);
                addstr("Enter letter: ");



Home | Main Index | Thread Index | Old Index