summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Bursa <james@netsurf-browser.org>2008-06-22 15:52:42 +0000
committerJames Bursa <james@netsurf-browser.org>2008-06-22 15:52:42 +0000
commit8edc3daad7debb8e5d746c1b345c4de76c68a3a0 (patch)
tree3e695f5f7aada143230a4e66c750a88393e1d26f
parent53ee8f6ff874e075ee4642a1ccdb6b3c056e6e9f (diff)
downloadlibnsgif-8edc3daad7debb8e5d746c1b345c4de76c68a3a0.tar.gz
libnsgif-8edc3daad7debb8e5d746c1b345c4de76c68a3a0.tar.bz2
Try and display the GIF anyway if an error code is returned.
svn path=/branches/dynis/libnsgif/; revision=4420
-rw-r--r--examples/decode_gif.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/examples/decode_gif.c b/examples/decode_gif.c
index 47cbc97..4dc9efb 100644
--- a/examples/decode_gif.c
+++ b/examples/decode_gif.c
@@ -27,7 +27,7 @@
#include <libnsgif.h>
char *load_file(const char *path, size_t *data_size);
-void die(const char *context, int code);
+void warning(const char *context, int code);
void *bitmap_create(int width, int height);
void bitmap_set_opaque(void *bitmap, bool opaque);
bool bitmap_test_opaque(void *bitmap);
@@ -70,7 +70,7 @@ int main(int argc, char *argv[])
do {
code = gif_initialise(&gif, &bitmap_callbacks);
if (code != 0 && code != 1)
- die("gif_initialise", code);
+ warning("gif_initialise", code);
} while (code != 1);
printf("P3\n");
@@ -90,7 +90,7 @@ int main(int argc, char *argv[])
code = gif_decode_frame(&gif, i, &bitmap_callbacks);
if (code != 0)
- die("gif_decode_frame", code);
+ warning("gif_decode_frame", code);
printf("# frame %u:\n", i);
image = (char *) gif.frame_image;
@@ -150,7 +150,7 @@ char *load_file(const char *path, size_t *data_size)
}
-void die(const char *context, int code)
+void warning(const char *context, int code)
{
fprintf(stderr, "%s failed: ", context);
switch (code)
@@ -175,7 +175,6 @@ void die(const char *context, int code)
break;
}
fprintf(stderr, "\n");
- exit(EXIT_FAILURE);
}