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]); }