Module Name:    src
Committed By:   christos
Date:           Fri Jan 27 15:37:09 UTC 2012

Modified Files:
        src/lib/libcurses: getstr.c

Log Message:
handle the case where we have no space properly (Nat Sloss)


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/lib/libcurses/getstr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libcurses/getstr.c
diff -u src/lib/libcurses/getstr.c:1.21 src/lib/libcurses/getstr.c:1.22
--- src/lib/libcurses/getstr.c:1.21	Fri Jan  6 17:20:54 2012
+++ src/lib/libcurses/getstr.c	Fri Jan 27 10:37:09 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: getstr.c,v 1.21 2012/01/06 22:20:54 christos Exp $	*/
+/*	$NetBSD: getstr.c,v 1.22 2012/01/27 15:37:09 christos Exp $	*/
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -35,7 +35,7 @@
 #if 0
 static char sccsid[] = "@(#)getstr.c	8.2 (Berkeley) 5/4/94";
 #else
-__RCSID("$NetBSD: getstr.c,v 1.21 2012/01/06 22:20:54 christos Exp $");
+__RCSID("$NetBSD: getstr.c,v 1.22 2012/01/27 15:37:09 christos Exp $");
 #endif
 #endif				/* not lint */
 
@@ -241,17 +241,14 @@ __wgetnstr(WINDOW *win, char *str, int n
 			wmove(win, win->cury, xpos);
 		} else {
 			if (remain) {
-				if (iscntrl((unsigned char)c)) {
+				if (iscntrl((unsigned char)c))
 					mvwaddch(win, win->cury, xpos, ' ');
-					wmove(win, win->cury, xpos + 1);
-				}
 				str++;
 				xpos++;
 				remain--;
-			} else {
+			} else
 				mvwaddch(win, win->cury, xpos, ' ');
-				wmove(win, win->cury, xpos - 1);
-			}
+			wmove(win, win->cury, xpos);
 		}
 	}
 

Reply via email to