Reformat stuff

This commit is contained in:
Isaac Shoebottom 2023-12-04 20:09:46 -04:00
parent d81bbe423e
commit a62d97f575
2 changed files with 6 additions and 7 deletions

View File

@ -16,14 +16,14 @@
* THIS SPECIFICATION IS PROVIDED AS IS, AND COPYRIGHT HOLD-ERS * THIS SPECIFICATION IS PROVIDED AS IS, AND COPYRIGHT HOLD-ERS
* MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR * MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
* IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, COPYRIGHT * IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, COPYRIGHT
* HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES OF MER-CHANTABILITY * HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY
* OR FITNESS FOR ANY PARTICULAR PURPOSE OR * OR FITNESS FOR ANY PARTICULAR PURPOSE OR
* THAT THE USE OF THE SPECIFICATION WILL NOT INFRINGE ANY * THAT THE USE OF THE SPECIFICATION WILL NOT INFRINGE ANY
* THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER * THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER
* RIGHTS. COPYRIGHT HOLDERS WILL BEAR NO LIABILITY FOR ANY * RIGHTS. COPYRIGHT HOLDERS WILL BEAR NO LIABILITY FOR ANY
* USE OF THIS SPECIFICATION. * USE OF THIS SPECIFICATION.
* The name and trademarks of copyright holders may NOT be used in * The name and trademarks of copyright holders may NOT be used in
* ad-vertising or publicity pertaining to the specification without specific, written * advertising or publicity pertaining to the specification without specific, written
* prior permission. Title to copyright in this specification and any associated * prior permission. Title to copyright in this specification and any associated
* documentation will at all times remain with copyright holders. * documentation will at all times remain with copyright holders.
*/ */
@ -111,12 +111,12 @@ png_chunk **get_png_chunks(char *buffer) {
if (memcmp(chunks[i]->type, "IEND", 4) == 0) { if (memcmp(chunks[i]->type, "IEND", 4) == 0) {
break; break;
} }
chunks = realloc(chunks, sizeof(png_chunk *) * (i + 2)); i++;
chunks = realloc(chunks, sizeof(png_chunk *) * (i + 1));
if (chunks == NULL) { if (chunks == NULL) {
perror("realloc"); perror("realloc");
exit(1); exit(1);
} }
i++;
} }
return chunks; return chunks;
} }

View File

@ -16,14 +16,14 @@
* THIS SPECIFICATION IS PROVIDED AS IS, AND COPYRIGHT HOLD-ERS * THIS SPECIFICATION IS PROVIDED AS IS, AND COPYRIGHT HOLD-ERS
* MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR * MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
* IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, COPYRIGHT * IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, COPYRIGHT
* HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES OF MER-CHANTABILITY * HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY
* OR FITNESS FOR ANY PARTICULAR PURPOSE OR * OR FITNESS FOR ANY PARTICULAR PURPOSE OR
* THAT THE USE OF THE SPECIFICATION WILL NOT INFRINGE ANY * THAT THE USE OF THE SPECIFICATION WILL NOT INFRINGE ANY
* THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER * THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER
* RIGHTS. COPYRIGHT HOLDERS WILL BEAR NO LIABILITY FOR ANY * RIGHTS. COPYRIGHT HOLDERS WILL BEAR NO LIABILITY FOR ANY
* USE OF THIS SPECIFICATION. * USE OF THIS SPECIFICATION.
* The name and trademarks of copyright holders may NOT be used in * The name and trademarks of copyright holders may NOT be used in
* ad-vertising or publicity pertaining to the specification without specific, written * advertising or publicity pertaining to the specification without specific, written
* prior permission. Title to copyright in this specification and any associated * prior permission. Title to copyright in this specification and any associated
* documentation will at all times remain with copyright holders. * documentation will at all times remain with copyright holders.
*/ */
@ -33,7 +33,6 @@
#include <arpa/inet.h> #include <arpa/inet.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <zlib.h>
#include <string.h> #include <string.h>
// http://www.libpng.org/pub/png/spec/1.2/PNG-Rationale.html#R.PNG-file-signature // http://www.libpng.org/pub/png/spec/1.2/PNG-Rationale.html#R.PNG-file-signature