X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Fbase%2Flib_nl.c;h=df07349fc83c02577715efa2b00c6dcb993e0d80;hp=c3a830bdc037dc8b9e06f4d2ede63afb67bd5847;hb=d6c65d287166c3105ece4a5e3f3ec7af5a5f26a3;hpb=78e49873c69dc0494bb34c62f897f8b446584a33;ds=sidebyside diff --git a/ncurses/base/lib_nl.c b/ncurses/base/lib_nl.c index c3a830bd..df07349f 100644 --- a/ncurses/base/lib_nl.c +++ b/ncurses/base/lib_nl.c @@ -1,5 +1,6 @@ /**************************************************************************** - * Copyright (c) 1998-2000,2009 Free Software Foundation, Inc. * + * Copyright 2020 Thomas E. Dickey * + * Copyright 1998-2000,2009 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 * @@ -44,7 +45,7 @@ #include -MODULE_ID("$Id: lib_nl.c,v 1.9 2009/02/15 00:38:22 tom Exp $") +MODULE_ID("$Id: lib_nl.c,v 1.13 2020/02/02 23:34:34 tom Exp $") #ifdef __EMX__ #include @@ -53,15 +54,14 @@ MODULE_ID("$Id: lib_nl.c,v 1.9 2009/02/15 00:38:22 tom Exp $") NCURSES_EXPORT(int) NCURSES_SP_NAME(nl) (NCURSES_SP_DCL0) { - T((T_CALLED("nl()"))); - + T((T_CALLED("nl(%p)"), (void *) SP_PARM)); + if (0 == SP_PARM) + returnCode(ERR); SP_PARM->_nl = TRUE; - #ifdef __EMX__ _nc_flush(); - _fsetmode(NC_OUTPUT, "t"); + _fsetmode(NC_OUTPUT(SP_PARM), "t"); #endif - returnCode(OK); } @@ -76,15 +76,14 @@ nl(void) NCURSES_EXPORT(int) NCURSES_SP_NAME(nonl) (NCURSES_SP_DCL0) { - T((T_CALLED("nonl()"))); - + T((T_CALLED("nonl(%p)"), (void *) SP_PARM)); + if (0 == SP_PARM) + returnCode(ERR); SP_PARM->_nl = FALSE; - #ifdef __EMX__ _nc_flush(); - _fsetmode(NC_OUTPUT, "b"); + _fsetmode(NC_OUTPUT(SP_PARM), "b"); #endif - returnCode(OK); }