]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/base/lib_nl.c
ncurses 6.1 - patch 20191207
[ncurses.git] / ncurses / base / lib_nl.c
index c3a830bdc037dc8b9e06f4d2ede63afb67bd5847..34254871c985918c9b31d7b044f79b597c7788af 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
 /****************************************************************************
- * Copyright (c) 1998-2000,2009 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2008,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            *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -44,7 +44,7 @@
 
 #include <curses.priv.h>
 
 
 #include <curses.priv.h>
 
-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.12 2009/10/24 22:05:55 tom Exp $")
 
 #ifdef __EMX__
 #include <io.h>
 
 #ifdef __EMX__
 #include <io.h>
@@ -53,15 +53,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)
 {
 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;
     SP_PARM->_nl = TRUE;
-
 #ifdef __EMX__
     _nc_flush();
 #ifdef __EMX__
     _nc_flush();
-    _fsetmode(NC_OUTPUT, "t");
+    _fsetmode(NC_OUTPUT(SP_PARM), "t");
 #endif
 #endif
-
     returnCode(OK);
 }
 
     returnCode(OK);
 }
 
@@ -76,15 +75,14 @@ nl(void)
 NCURSES_EXPORT(int)
 NCURSES_SP_NAME(nonl) (NCURSES_SP_DCL0)
 {
 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;
     SP_PARM->_nl = FALSE;
-
 #ifdef __EMX__
     _nc_flush();
 #ifdef __EMX__
     _nc_flush();
-    _fsetmode(NC_OUTPUT, "b");
+    _fsetmode(NC_OUTPUT(SP_PARM), "b");
 #endif
 #endif
-
     returnCode(OK);
 }
 
     returnCode(OK);
 }