X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Fbase%2Flib_move.c;h=652c44d7b7181816d18d50f83d126130e43cf969;hp=6f5bddff33ea3bd80b8035569bc3f9b6a3f55c01;hb=3ec8f79f3ceda990461c80de2f96d66b886e00d5;hpb=0eb88fc5281804773e2a0c7a488a4452463535ce diff --git a/ncurses/base/lib_move.c b/ncurses/base/lib_move.c index 6f5bddff..652c44d7 100644 --- a/ncurses/base/lib_move.c +++ b/ncurses/base/lib_move.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998-2000,2004 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,9 +29,9 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * + * and: Thomas E. Dickey 1996-on * ****************************************************************************/ - /* ** lib_move.c ** @@ -41,23 +41,20 @@ #include -MODULE_ID("$Id: lib_move.c,v 1.8 1998/02/11 12:13:53 tom Exp $") +MODULE_ID("$Id: lib_move.c,v 1.12 2004/12/04 21:50:07 tom Exp $") -int +NCURSES_EXPORT(int) wmove(WINDOW *win, int y, int x) { - T((T_CALLED("wmove(%p,%d,%d)"), win, y, x)); + T((T_CALLED("wmove(%p,%d,%d)"), win, y, x)); - if (win && - x >= 0 && x <= win->_maxx && - y >= 0 && y <= win->_maxy) - { - win->_curx = (short)x; - win->_cury = (short)y; + if (LEGALYX(win, y, x)) { + win->_curx = (NCURSES_SIZE_T) x; + win->_cury = (NCURSES_SIZE_T) y; - win->_flags &= ~_WRAPPED; - win->_flags |= _HASMOVED; - returnCode(OK); - } else - returnCode(ERR); + win->_flags &= ~_WRAPPED; + win->_flags |= _HASMOVED; + returnCode(OK); + } else + returnCode(ERR); }