summaryrefslogtreecommitdiff
path: root/ff2png.c
diff options
context:
space:
mode:
authorFRIGN <dev@frign.de>2015-11-10 18:51:57 +0100
committerFRIGN <dev@frign.de>2015-11-10 18:51:57 +0100
commitba60aa33d91ba7329218117c067c4f5940b9d001 (patch)
tree3680ac9ca9e806d2870914160d579867f916f537 /ff2png.c
parentbc58a701d118e074c935bf29af095d72b95f8a31 (diff)
Remove arg.h
No need for this when the tools don't accept arguments.
Diffstat (limited to 'ff2png.c')
-rw-r--r--ff2png.c26
1 files changed, 7 insertions, 19 deletions
diff --git a/ff2png.c b/ff2png.c
index abf2f09..5809da6 100644
--- a/ff2png.c
+++ b/ff2png.c
@@ -4,38 +4,25 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <png.h>
-
-#include "arg.h"
-char *argv0;
+#include <png.h>
#define HEADER_FORMAT "farbfeld########"
-static void
-usage(void)
-{
- fprintf(stderr, "usage: %s\n", argv0);
- exit(1);
-}
-
int
main(int argc, char *argv[])
{
png_structp png_struct_p;
png_infop png_info_p;
- uint8_t hdr[17], *png_row;
+ uint8_t hdr[16], *png_row;
uint16_t tmp16;
png_uint_32 width, height, i;
png_size_t png_row_len, j;
- ARGBEGIN {
- default:
- usage();
- } ARGEND;
-
- if (argc)
- usage();
+ if (argc > 1) {
+ fprintf(stderr, "usage: %s\n", argv[0]);
+ return 1;
+ }
/* header */
if (fread(hdr, 1, strlen(HEADER_FORMAT), stdin) != strlen(HEADER_FORMAT)) {
@@ -87,5 +74,6 @@ main(int argc, char *argv[])
png_free_data(png_struct_p, png_info_p, PNG_FREE_ALL, -1);
png_destroy_write_struct(&png_struct_p, NULL);
free(png_row);
+
return 0;
}