Module Name: src Committed By: dholland Date: Sun Mar 30 05:41:50 UTC 2014
Modified Files: src/games/hunt/hunt: playit.c Log Message: fix off-by-one To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/games/hunt/hunt/playit.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/games/hunt/hunt/playit.c diff -u src/games/hunt/hunt/playit.c:1.22 src/games/hunt/hunt/playit.c:1.23 --- src/games/hunt/hunt/playit.c:1.22 Sun Mar 30 05:38:13 2014 +++ src/games/hunt/hunt/playit.c Sun Mar 30 05:41:50 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: playit.c,v 1.22 2014/03/30 05:38:13 dholland Exp $ */ +/* $NetBSD: playit.c,v 1.23 2014/03/30 05:41:50 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: playit.c,v 1.22 2014/03/30 05:38:13 dholland Exp $"); +__RCSID("$NetBSD: playit.c,v 1.23 2014/03/30 05:41:50 dholland Exp $"); #endif /* not lint */ #include <sys/file.h> @@ -246,7 +246,7 @@ send_stuff(void) char *sp, *nsp; static char inp[sizeof Buf]; - count = read(STDIN_FILENO, Buf, sizeof Buf); + count = read(STDIN_FILENO, Buf, sizeof(Buf) - 1); if (count <= 0) return; if (nchar_send <= 0 && !no_beep) {