X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fxvasprintf.c;h=6a8bac4a8866727b5578b3afca69a2310238c46c;hb=b187ff0528e2a081392a834e684d1d0c161708a7;hp=bd683627ef410d0b02a099043b238018e6b8949a;hpb=6e2afe5ad7c90ae9422ae2657dd842deed21731e;p=gnulib.git
diff --git a/lib/xvasprintf.c b/lib/xvasprintf.c
index bd683627e..6a8bac4a8 100644
--- a/lib/xvasprintf.c
+++ b/lib/xvasprintf.c
@@ -1,19 +1,18 @@
/* vasprintf and asprintf with out-of-memory checking.
- Copyright (C) 1999, 2002-2004, 2006, 2007 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002-2004, 2006-2010 Free Software Foundation, Inc.
- This program is free software; you can redistribute it and/or modify
+ This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see . */
#include
@@ -30,11 +29,6 @@
/* Checked size_t computations. */
#include "xsize.h"
-/* Some systems, like OSF/1 4.0 and Woe32, don't have EOVERFLOW. */
-#ifndef EOVERFLOW
-# define EOVERFLOW E2BIG
-#endif
-
static inline char *
xstrcat (size_t argcount, va_list args)
{
@@ -92,23 +86,23 @@ xvasprintf (const char *format, va_list args)
for (f = format;;)
{
- if (*f == '\0')
- /* Recognized the special case of string concatenation. */
- return xstrcat (argcount, args);
- if (*f != '%')
- break;
- f++;
- if (*f != 's')
- break;
- f++;
- argcount++;
+ if (*f == '\0')
+ /* Recognized the special case of string concatenation. */
+ return xstrcat (argcount, args);
+ if (*f != '%')
+ break;
+ f++;
+ if (*f != 's')
+ break;
+ f++;
+ argcount++;
}
}
if (vasprintf (&result, format, args) < 0)
{
if (errno == ENOMEM)
- xalloc_die ();
+ xalloc_die ();
return NULL;
}