projects
/
ncurses.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ncurses 5.9 - patch 20121215
[ncurses.git]
/
test
/
movewindow.c
diff --git
a/test/movewindow.c
b/test/movewindow.c
index 11521a0722388bc06fd9bbe728eb9d5d7915a3ce..612cb8823cb75cbabb200f2f9701654a5a72d1e2 100644
(file)
--- a/
test/movewindow.c
+++ b/
test/movewindow.c
@@
-26,7
+26,7
@@
* authorization. *
****************************************************************************/
/*
* authorization. *
****************************************************************************/
/*
- * $Id: movewindow.c,v 1.3
7 2012/10/27 19:37:56
tom Exp $
+ * $Id: movewindow.c,v 1.3
8 2012/12/15 18:36:40
tom Exp $
*
* Demonstrate move functions for windows and derived windows from the curses
* library.
*
* Demonstrate move functions for windows and derived windows from the curses
* library.
@@
-218,8
+218,16
@@
selectcell(WINDOW *parent,
res.x = ulj + j;
return (&res);
}
res.x = ulj + j;
return (&res);
}
- i %= si;
- j %= sj;
+
+ if (si <= 0)
+ i = 0;
+ else
+ i %= si;
+
+ if (sj <= 0)
+ j = 0;
+ else
+ j %= sj;
/*
* If the caller can handle continuous movement, return the result.
/*
* If the caller can handle continuous movement, return the result.