]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/base/safe_sprintf.c
ncurses 6.1 - patch 20180210
[ncurses.git] / ncurses / base / safe_sprintf.c
index 34abd2f8cf47409bfe9973a1dfba78f96b861f06..6c17286ba5c3089d80fa3598e390841a47680b64 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
 /****************************************************************************
- * Copyright (c) 1998-2012,2013 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2013,2018 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            *
@@ -33,7 +33,7 @@
 #include <curses.priv.h>
 #include <ctype.h>
 
 #include <curses.priv.h>
 #include <ctype.h>
 
-MODULE_ID("$Id: safe_sprintf.c,v 1.27 2013/01/20 01:04:32 tom Exp $")
+MODULE_ID("$Id: safe_sprintf.c,v 1.29 2018/02/10 17:52:19 tom Exp $")
 
 #if USE_SAFE_SPRINTF
 
 
 #if USE_SAFE_SPRINTF
 
@@ -224,6 +224,10 @@ NCURSES_SP_NAME(_nc_printf_string) (NCURSES_SP_DCLx
 {
     char *result = 0;
 
 {
     char *result = 0;
 
+#if NCURSES_SP_FUNCS
+    (void) sp;
+#endif
+
     if (fmt != 0) {
 #if USE_SAFE_SPRINTF
        va_list ap2;
     if (fmt != 0) {
 #if USE_SAFE_SPRINTF
        va_list ap2;
@@ -259,9 +263,9 @@ NCURSES_SP_NAME(_nc_printf_string) (NCURSES_SP_DCLx
 
        if (my_buffer != 0) {
 # if HAVE_VSNPRINTF
 
        if (my_buffer != 0) {
 # if HAVE_VSNPRINTF
-           vsnprintf(my_buffer, my_length, fmt, ap);   /* GNU extension */
+           vsnprintf(my_buffer, my_length, fmt, ap);   /* SUSv2, 1997 */
 # else
 # else
-           vsprintf(my_buffer, fmt, ap);       /* ANSI */
+           vsprintf(my_buffer, fmt, ap);       /* ISO/ANSI C, 1989 */
 # endif
            result = my_buffer;
        }
 # endif
            result = my_buffer;
        }