Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/wsmoused Fix a bug that caused the program to enter...



details:   https://anonhg.NetBSD.org/src/rev/44374d6c6b31
branches:  trunk
changeset: 540825:44374d6c6b31
user:      jmmv <jmmv%NetBSD.org@localhost>
date:      Wed Dec 25 19:04:27 2002 +0000

description:
Fix a bug that caused the program to enter an infinite loop when selecting
an empty line.

This closes my own PR bin/19160. Reviewed by wiz.

diffstat:

 usr.sbin/wsmoused/selection.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r b93626759498 -r 44374d6c6b31 usr.sbin/wsmoused/selection.c
--- a/usr.sbin/wsmoused/selection.c     Wed Dec 25 17:31:53 2002 +0000
+++ b/usr.sbin/wsmoused/selection.c     Wed Dec 25 19:04:27 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: selection.c,v 1.2 2002/07/04 20:50:29 christos Exp $ */
+/* $NetBSD: selection.c,v 1.3 2002/12/25 19:04:27 jmmv Exp $ */
 
 /*
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #include <sys/cdefs.h>
 
 #ifndef lint
-__RCSID("$NetBSD: selection.c,v 1.2 2002/07/04 20:50:29 christos Exp $");
+__RCSID("$NetBSD: selection.c,v 1.3 2002/12/25 19:04:27 jmmv Exp $");
 #endif /* not lint */
 
 #include <sys/ioctl.h>
@@ -116,7 +116,7 @@
                if (ioctl(m->tty_fd, WSDISPLAYIO_GETWSCHAR, &ch) == -1)
                        warn("ioctl(WSDISPLAYIO_GETWSCHAR) failed");
                ch.col--;
-       } while (isspace((unsigned char)ch.letter));
+       } while (isspace((unsigned char)ch.letter) && ch.col >= 0);
        return ch.col + 2;
 }
 



Home | Main Index | Thread Index | Old Index