[hackers] [farbfeld] Clean up png2ff, remove debug leftovers || FRIGN

From: <git_AT_suckless.org>
Date: Mon, 4 Jan 2016 18:30:01 +0100 (CET)

commit 3ddd2265c4de0ce0b9d9dc7a80dd85aab054d2ae
Author: FRIGN <dev_AT_frign.de>
AuthorDate: Mon Jan 4 18:29:44 2016 +0100
Commit: FRIGN <dev_AT_frign.de>
CommitDate: Mon Jan 4 18:29:44 2016 +0100

    Clean up png2ff, remove debug leftovers
    
    Thanks Dimitris, Hiltjo!

diff --git a/png2ff.c b/png2ff.c
index 9f77344..5b75dfa 100644
--- a/png2ff.c
+++ b/png2ff.c
_AT_@ -18,7 +18,7 @@ main(int argc, char *argv[])
         uint16_t tmp16;
 
         if (argc > 1) {
- fprintf(stderr, "usage:%s\n", argv[0]);
+ fprintf(stderr, "usage: %s\n", argv[0]);
                 return 1;
         }
 
_AT_@ -27,10 +27,12 @@ main(int argc, char *argv[])
                                               NULL, NULL);
         png_info_p = png_create_info_struct(png_struct_p);
 
- if (!png_struct_p || !png_info_p || setjmp(png_jmpbuf(png_struct_p))) {
+ if (!png_struct_p || !png_info_p) {
                 fprintf(stderr, "failed to initialize libpng\n");
                 return 1;
         }
+ if (setjmp(png_jmpbuf(png_struct_p)))
+ return 1;
         png_init_io(png_struct_p, stdin);
         if (png_get_valid(png_struct_p, png_info_p, PNG_INFO_tRNS))
                 png_set_tRNS_to_alpha(png_struct_p);
_AT_@ -69,7 +71,6 @@ main(int argc, char *argv[])
                                 fwrite(&tmp16, sizeof(uint16_t), 1, stdout);
                         }
                 }
- fprintf(stderr, "written r=%d, i=%d\n", r, i);
         } else {
                 fprintf(stderr, "format error\n");
                 return 1;
Received on Mon Jan 04 2016 - 18:30:01 CET

This archive was generated by hypermail 2.3.0 : Mon Jan 04 2016 - 18:36:15 CET