summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <programble@gmail.com>2018-03-02 15:39:07 -0500
committerJune McEnroe <programble@gmail.com>2018-03-02 15:39:07 -0500
commita7a39d72d92c32444fa48e0676d65ce23b205ae2 (patch)
tree7ad44ca4b028356614e957dfcb1366031725f7a7
parentAdd verbose flag to pngo (diff)
downloadsrc-a7a39d72d92c32444fa48e0676d65ce23b205ae2.tar.gz
src-a7a39d72d92c32444fa48e0676d65ce23b205ae2.zip
Skip chunks by reading in pngo
Pipes.
-rw-r--r--bin/pngo.c11
1 files changed, 6 insertions, 5 deletions
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;
5c6b61b1f36f47ecc819f19&follow=1'>Revert "Enable cookies in title"June McEnroe 2019-09-20Enable cookies in titleJune McEnroe 2019-09-16Use sensitivity aliases in TF2June McEnroe 2019-09-16Add The Just CityJune McEnroe 2019-09-12Only GET the final redirect locationJune McEnroe 2019-09-12Consume entire bodyJune McEnroe 2019-09-10Add title -v flagJune McEnroe 2019-09-10Use curl error bufferJune McEnroe 2019-09-10Set Accept-Encoding in titleJune McEnroe 2019-09-08Set title User-AgentJune McEnroe 2019-09-07Add -x flag to titleJune McEnroe 2019-09-07Ignore SIGPIPE in relayJune McEnroe 2019-09-07Add A Memory Called EmpireJune McEnroe 2019-09-05Handle lack of Content-TypeJune McEnroe 2019-09-05Use CURLINFO_CONTENT_TYPEJune McEnroe 2019-09-05Decode entities in titlesJune McEnroe 2019-09-05Print title as soon as it's availableJune McEnroe 2019-09-05Use CURL_PREFIX to set flagsJune McEnroe 2019-09-05Add titleJune McEnroe 2019-09-04Add Avorter n'est pas tuerJune McEnroe 2019-08-29Unset executable on shell scriptsJune McEnroe 2019-08-29Add long-missing setopt to bin.7June McEnroe 2019-08-29Add editJune McEnroe