* authorization. *
****************************************************************************/
/*
- * $Id: movewindow.c,v 1.37 2012/10/27 19:37:56 tom Exp $
+ * $Id: movewindow.c,v 1.38 2012/12/15 18:36:40 tom Exp $
*
* Demonstrate move functions for windows and derived windows from the curses
* library.
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.