From a7a39d72d92c32444fa48e0676d65ce23b205ae2 Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Fri, 2 Mar 2018 15:39:07 -0500 Subject: Skip chunks by reading in pngo Pipes. --- bin/pngo.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'bin') diff --git a/bin/pngo.c b/bin/pngo.c index c7a37bd9..5ce62797 100644 --- a/bin/pngo.c +++ b/bin/pngo.c @@ -88,11 +88,6 @@ static struct Chunk readChunk(void) { return chunk; } -static void skipChunk(struct Chunk chunk) { - int error = fseek(file, chunk.size + 4, SEEK_CUR); - if (error) err(EX_IOERR, "%s", path); -} - static void writeChunk(struct Chunk chunk) { chunk.size = htonl(chunk.size); writeExpect(&chunk, sizeof(chunk)); @@ -117,6 +112,12 @@ static void writeCrc(void) { writeExpect(&net, sizeof(net)); } +static void skipChunk(struct Chunk chunk) { + uint8_t discard[chunk.size]; + readExpect(discard, sizeof(discard), "chunk data"); + readCrc(); +} + static struct PACKED { uint32_t width; uint32_t height; -- cgit 1.4.1 /log/home/.bin?follow=1'>log tree commit diff
path: root/home/.bin (unfollow)
Commit message (Expand)Author
2017-09-15Use 4-space indent everywhereJune McEnroe
2017-09-15Rename zsh scripts .zshJune McEnroe
2017-09-15Rename files directory etcJune McEnroe
2017-09-15Remove Code Tarmak 2 layoutJune McEnroe
2017-09-14Draw line in typoJune McEnroe
2017-09-14Count 5 letters as a wordJune McEnroe
2017-09-14Add .gitignore target to bins MakefileJune McEnroe
2017-09-14Add typing gameJune McEnroe
2017-09-13Include sys/types.h in wake.cJune McEnroe
2017-09-06Move C file description commentsJune McEnroe
2017-09-06Fix bin/Makefile FreeBSD compatibilityJune McEnroe
2017-09-06Remove C code from link scriptJune McEnroe
2017-09-06Move C code to bin, Makefile, AGPLJune McEnroe
2017-09-06Rename curtis -> homeJune McEnroe
2017-09-05Pass final NULL to execlpJune McEnroe
2017-09-05Add watch.cJune McEnroe
2017-09-02Remove Scala highlightingJune McEnroe
2017-08-31Fix Linux console Tarmak 3June McEnroe
2017-08-31Use Tarmak 3 on Linux consoleJune McEnroe
2017-08-25Install ddateJune McEnroe
2017-08-19Move nethack options to envJune McEnroe
2017-08-17Remove scala syntax fileJune McEnroe
2017-08-06Add wakeJune McEnroe
2017-08-04Use $() in install.shJune McEnroe
2017-08-02Create Code Tarmak 3 layoutJune McEnroe
2017-07-31Add tupJune McEnroe
2017-07-31Use designated initializer for hnel tableJune McEnroe
2017-07-30Add juneJune McEnroe
2017-07-30Play nethack as ValkyrieJune McEnroe
2017-07-28Add toggle to hnelJune McEnroe
2017-07-28Install slJune McEnroe
2017-07-25Add up, supJune McEnroe
2017-07-24Autopickup ringsJune McEnroe
2017-07-24Name dogJune McEnroe
2017-07-23Add nethackrcJune McEnroe
2017-07-23Remove useless setuid in briJune McEnroe
2017-07-23Clean up hnel a tiny bitJune McEnroe
2017-07-21Set window size in hnelJune McEnroe
2017-07-21Add hnelJune McEnroe
2017-07-19chmod 600 in dtchJune McEnroe