diff options
author | Ray Lai <ray@cvs.openbsd.org> | 2007-03-02 04:32:33 +0000 |
---|---|---|
committer | Ray Lai <ray@cvs.openbsd.org> | 2007-03-02 04:32:33 +0000 |
commit | ee4d88ad7057b1d6bc161923816bc92e608b5112 (patch) | |
tree | 11ab32f9c00b988d7e67f57549412e979b11d5ca /games/monop/monop.c | |
parent | 14c53d4817d194407a6f4e37fb939e4fbbfe6104 (diff) |
strlen fixes from Charles Longeau.
OK moritz@.
Diffstat (limited to 'games/monop/monop.c')
-rw-r--r-- | games/monop/monop.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/games/monop/monop.c b/games/monop/monop.c index 902450fea05..2392882f578 100644 --- a/games/monop/monop.c +++ b/games/monop/monop.c @@ -1,4 +1,4 @@ -/* $OpenBSD: monop.c,v 1.7 2003/06/03 03:01:40 millert Exp $ */ +/* $OpenBSD: monop.c,v 1.8 2007/03/02 04:32:32 ray Exp $ */ /* $NetBSD: monop.c,v 1.3 1995/03/23 08:34:52 cgd Exp $ */ /* @@ -40,7 +40,7 @@ static const char copyright[] = #if 0 static char sccsid[] = "@(#)monop.c 8.1 (Berkeley) 5/31/93"; #else -static const char rcsid[] = "$OpenBSD: monop.c,v 1.7 2003/06/03 03:01:40 millert Exp $"; +static const char rcsid[] = "$OpenBSD: monop.c,v 1.8 2007/03/02 04:32:32 ray Exp $"; #endif #endif /* not lint */ @@ -111,8 +111,7 @@ blew_it: printf("user closed input stream, quitting...\n"); exit(0); } - sp = buf + strlen(buf) - 1; - if (*sp == '\n') + if ((sp = strchr(buf, '\n')) != NULL) *sp = '\0'; } while (strlen(buf) == 0); if ((name_list[i] = play[i].name = strdup(buf)) == NULL) |