diff lib/vasnprintf.c @ 11511:d604b921ed8d

Simplify calling convention of u*_conv_from_encoding.
author Bruno Haible <bruno@clisp.org>
date Sun, 26 Apr 2009 16:43:25 +0200
parents ef4e896a3b4f
children 73f84ac92381
line wrap: on
line diff
--- a/lib/vasnprintf.c
+++ b/lib/vasnprintf.c
@@ -2493,14 +2493,13 @@
 		  }
 
 		  /* 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 @@
 # 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))