Sisyphus repositório
Última atualização: 1 outubro 2023 | SRPMs: 18631 | Visitas: 37824767
en ru br
ALT Linux repositórios
S:2.38.0.23.0e1ef6779a-alt1
5.0: 2.9-alt5
4.1: 2.5.1-alt4.M41.2
4.0: 2.5-alt4.M40.2
3.0: 2.3.5-alt5

Outros repositórios

Group :: Sistema/Base
RPM: glibc

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs e FR  Repocop 

Patch: glibc-2.3.5-alt-asprintf.patch
Download


2004-06-03  Dmitry V. Levin <ldv@altlinux.org>
	* libio/vasprintf.c (_IO_vasprintf): Reset the result pointer
	to NULL on any error.
	* manual/stdio.texi: Reflect the change in asprintf API.
diff -uprk.orig glibc-2.3.5.orig/libio/vasprintf.c glibc-2.3.5/libio/vasprintf.c
--- glibc-2.3.5.orig/libio/vasprintf.c	2004-09-26 05:10:53 +0000
+++ glibc-2.3.5/libio/vasprintf.c	2005-05-08 22:15:38 +0000
@@ -48,7 +48,10 @@ _IO_vasprintf (result_ptr, format, args)
   _IO_size_t allocated;
   string = (char *) malloc (init_string_size);
   if (string == NULL)
-    return -1;
+    {
+      *result_ptr = NULL;
+      return -1;
+    }
 #ifdef _IO_MTSAFE_IO
   sf._sbf._f._lock = NULL;
 #endif
@@ -62,6 +65,7 @@ _IO_vasprintf (result_ptr, format, args)
   if (ret < 0)
     {
       free (sf._sbf._f._IO_buf_base);
+      *result_ptr = NULL;
       return ret;
     }
   /* Only use realloc if the size we need is of the same (binary)
diff -uprk.orig glibc-2.3.5.orig/manual/stdio.texi glibc-2.3.5/manual/stdio.texi
--- glibc-2.3.5.orig/manual/stdio.texi	2002-06-30 03:35:21 +0000
+++ glibc-2.3.5/manual/stdio.texi	2005-05-08 22:15:38 +0000
@@ -2397,7 +2397,9 @@ to the newly allocated string at that lo
 
 The return value is the number of characters allocated for the buffer, or
 less than zero if an error occurred. Usually this means that the buffer
-could not be allocated.
+could not be allocated, and the value of @var{ptr} in this situation is
+implementation-dependent (in glibc, @var{ptr} will be set to the null
+pointer, but this behavior should not be relied upon).
 
 Here is how to use @code{asprintf} to get the same result as the
 @code{snprintf} example, but more easily:
 
projeto & código: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
mantenedor atual: Michael Shigorin
mantenedor da tradução: Fernando Martini aka fmartini © 2009