[gdb] Use partial symbol table to find language for main
[deliverable/binutils-gdb.git] / zlib / examples / zran.c
index 617a13086fa48931343d69545bded3e752e577f1..4fec6594a6648e759343325ea39ee02b56f9d39d 100644 (file)
@@ -1,7 +1,12 @@
 /* zran.c -- example of zlib/gzip stream indexing and random access
- * Copyright (C) 2005 Mark Adler
+ * Copyright (C) 2005, 2012 Mark Adler
  * For conditions of distribution and use, see copyright notice in zlib.h
-   Version 1.0  29 May 2005  Mark Adler */
+   Version 1.1  29 Sep 2012  Mark Adler */
+
+/* Version History:
+ 1.0  29 May 2005  First version
+ 1.1  29 Sep 2012  Fix memory reallocation error
+ */
 
 /* Illustrate the use of Z_BLOCK, inflatePrime(), and inflateSetDictionary()
    for random access of a compressed file.  A file containing a zlib or gzip
@@ -22,7 +27,7 @@
    grows as needed to accommodate the points.
 
    To use the index, an offset in the uncompressed data is provided, for which
-   the latest accees point at or preceding that offset is located in the index.
+   the latest access point at or preceding that offset is located in the index.
    The input file is positioned to the specified location in the index, and if
    necessary the first few bits of the compressed data is read from the file.
    inflate is initialized with those bits and the 32K of uncompressed data, and
@@ -221,7 +226,7 @@ local int build_index(FILE *in, off_t span, struct access **built)
 
     /* clean up and return index (release unused entries in list) */
     (void)inflateEnd(&strm);
-    index = realloc(index, sizeof(struct point) * index->have);
+    index->list = realloc(index->list, sizeof(struct point) * index->have);
     index->size = index->have;
     *built = index;
     return index->size;
This page took 0.023348 seconds and 4 git commands to generate.