openat: detect Solaris fchownat bug
[pspp] / lib / vasnprintf.c
index 51375eb4e5ad6b2e88ad088fc7dafce8a6e8b780..661445cb41702b5d8498a877b413eeb2bcc8692f 100644 (file)
@@ -257,7 +257,7 @@ local_wcsnlen (const wchar_t *s, size_t maxlen)
 # ifndef decimal_point_char_defined
 #  define decimal_point_char_defined 1
 static char
-decimal_point_char ()
+decimal_point_char (void)
 {
   const char *point;
   /* Determine it in a multithread-safe way.  We know nl_langinfo is
@@ -2493,14 +2493,13 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                  }
 
                  /* Convert from TCHAR_T[] to DCHAR_T[].  */
-                 tmpdst = NULL;
-                 tmpdst_len = 0;
-                 if (DCHAR_CONV_FROM_ENCODING (locale_charset (),
-                                               iconveh_question_mark,
-                                               tmpsrc, characters,
-                                               NULL,
-                                               &tmpdst, &tmpdst_len)
-                     < 0)
+                 tmpdst =
+                   DCHAR_CONV_FROM_ENCODING (locale_charset (),
+                                             iconveh_question_mark,
+                                             tmpsrc, characters,
+                                             NULL,
+                                             NULL, &tmpdst_len);
+                 if (tmpdst == NULL)
                    {
                      int saved_errno = errno;
                      free (tmpsrc);
@@ -5216,14 +5215,13 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
 # else
                        tmpsrc = tmp;
 # endif
-                       tmpdst = NULL;
-                       tmpdst_len = 0;
-                       if (DCHAR_CONV_FROM_ENCODING (locale_charset (),
-                                                     iconveh_question_mark,
-                                                     tmpsrc, count,
-                                                     NULL,
-                                                     &tmpdst, &tmpdst_len)
-                           < 0)
+                       tmpdst =
+                         DCHAR_CONV_FROM_ENCODING (locale_charset (),
+                                                   iconveh_question_mark,
+                                                   tmpsrc, count,
+                                                   NULL,
+                                                   NULL, &tmpdst_len);
+                       if (tmpdst == NULL)
                          {
                            int saved_errno = errno;
                            if (!(result == resultbuf || result == NULL))
@@ -5478,6 +5476,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
 #undef TCHARS_PER_DCHAR
 #undef SNPRINTF
 #undef USE_SNPRINTF
+#undef DCHAR_SET
 #undef DCHAR_CPY
 #undef PRINTF_PARSE
 #undef DIRECTIVES