]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/base/keybound.c
ncurses 5.5
[ncurses.git] / ncurses / base / keybound.c
index 06a1f44fc2f8e28a07da041dc8239643ff33be9a..b982d226c830aa25708ebf5795062557d9d551b8 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1999-2000,2003 Free Software Foundation, Inc.              *
+ * Copyright (c) 1999-2003,2005 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            *
@@ -32,7 +32,7 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: keybound.c,v 1.4 2003/03/08 19:39:31 tom Exp $")
+MODULE_ID("$Id: keybound.c,v 1.5 2005/04/30 16:53:42 tom Exp $")
 
 /*
  * Returns the count'th string definition which is associated with the
@@ -42,6 +42,11 @@ MODULE_ID("$Id: keybound.c,v 1.4 2003/03/08 19:39:31 tom Exp $")
 NCURSES_EXPORT(char *)
 keybound(int code, int count)
 {
+    char *result = 0;
+
     T((T_CALLED("keybound(%d,%d)"), code, count));
-    returnPtr(_nc_expand_try(SP->_keytry, code, &count, 0));
+    if (SP != 0) {
+       result = _nc_expand_try(SP->_keytry, code, &count, 0);
+    }
+    returnPtr(result);
 }