Sisyphus repositório
Última atualização: 1 outubro 2023 | SRPMs: 18631 | Visitas: 37840465
en ru br
ALT Linux repositórios
S:7.0.3-alt1
5.0: 4.11-alt4
4.1: 4.11-alt3
4.0: 4.8-alt4
3.0: 4.8-alt2

Group :: Edição
RPM: texinfo

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs e FR  Repocop 

Patch: texinfo-4.13-rh-alt-readfile.patch
Download


--- texinfo/install-info/install-info.c
+++ texinfo/install-info/install-info.c
@@ -799,13 +799,11 @@ readfile (char *filename, int *sizep,
     char **compression_program)
 {
   char *real_name;
-  FILE *f;
-  int filled = 0;
-  int data_size = 8192;
+  unsigned data_size = 8192, filled = 0;
   char *data = xmalloc (data_size);
 
   /* If they passed the space for the file name to return, use it.  */
-  f = open_possibly_compressed_file (filename, create_callback,
+  FILE *f = open_possibly_compressed_file (filename, create_callback,
                                      opened_filename ? opened_filename
                                                      : &real_name,
                                      compression_program);
@@ -819,9 +817,9 @@ readfile (char *filename, int *sizep,
         break;
 
       filled += nread;
-      if (filled == data_size)
+      if (data_size - filled < 8192)
         {
-          data_size += 65536;
+          data_size <<= 1;
           data = xrealloc (data, data_size);
         }
     }
 
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