From 6fad34690702a43404de1c1d99a148b10daaf219 Mon Sep 17 00:00:00 2001 From: Tom Gilbert Date: Wed, 1 Nov 2000 21:22:25 +0000 Subject: [PATCH] let's not have a coredumping example app ;-) SVN revision: 3803 --- doc/index.html | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/doc/index.html b/doc/index.html index f50434e..fcb73c3 100644 --- a/doc/index.html +++ b/doc/index.html @@ -183,10 +183,10 @@ be dropped into the loaders directory with the others and all Imlib2 programs will automatically be able to use it - without a restart).
/* standard headers */
-#include <X11/Xlib.h>
-#include <Imlib2.h>
-#include <stdio.h>
-#include <string.h>
+#include <X11/Xlib.h>
+#include <Imlib2.h>
+#include <stdio.h>
+#include <string.h>
 
 /* main program */
 int main(int argc, char **argv)
@@ -201,11 +201,14 @@ int main(int argc, char **argv)
   /* if the load was successful */
   if (image)
     {
+      char *tmp;
       /* set the image we loaded as the current context image to work on */
       imlib_context_set_image(image);
       /* set the image format to be the format of the extension of our last */
       /* argument - i.e. .png = png, .tif = tiff etc. */
-      imlib_image_set_format(strrchr(argv[2], '.') + 1);
+      tmp = strrchr(argv[2], '.');
+      if(tmp)
+         imlib_image_set_format(tmp + 1);
       /* save the image */
       imlib_save_image(argv[2]);
     }