X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Fwidechar%2Flib_inwstr.c;h=a4f5b8ea2040b45b756550d3530a125075af47cb;hp=4cf7182ae06179cb9c84690d6c33746ff14a3f5a;hb=d1a026123ac051716cdc16278345c1fb5c843b79;hpb=c120fddebe9e9c1e2b29dbd744a6b1d03652bf8b diff --git a/ncurses/widechar/lib_inwstr.c b/ncurses/widechar/lib_inwstr.c index 4cf7182a..a4f5b8ea 100644 --- a/ncurses/widechar/lib_inwstr.c +++ b/ncurses/widechar/lib_inwstr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002-2004,2009 Free Software Foundation, Inc. * + * Copyright (c) 2002-2009,2011 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 * @@ -39,7 +39,7 @@ #include -MODULE_ID("$Id: lib_inwstr.c,v 1.5 2009/10/24 22:37:29 tom Exp $") +MODULE_ID("$Id: lib_inwstr.c,v 1.6 2011/05/28 22:49:49 tom Exp $") NCURSES_EXPORT(int) winnwstr(WINDOW *win, wchar_t *wstr, int n) @@ -93,8 +93,13 @@ NCURSES_EXPORT(int) winwstr(WINDOW *win, wchar_t *wstr) { int result = OK; + T((T_CALLED("winwstr(%p,%p)"), (void *) win, (void *) wstr)); - if (winnwstr(win, wstr, CCHARW_MAX * (win->_maxx - win->_curx + 1)) == ERR) + if (win == 0) { + result = ERR; + } else if (winnwstr(win, wstr, + CCHARW_MAX * (win->_maxx - win->_curx + 1)) == ERR) { result = ERR; + } returnCode(result); }