summaryrefslogtreecommitdiff
path: root/src/pngtogd.c
diff options
context:
space:
mode:
authorpierrejoye <none@none>2013-04-03 14:23:11 +0200
committerpierrejoye <none@none>2013-04-03 14:23:11 +0200
commite20413bf6b872a8c23f1704a89295c5897347c9d (patch)
treef34b5402f97cd826bb312e18677f3974d53bfd52 /src/pngtogd.c
parent385566e4ba57d803921a13306ead66f354cee0a2 (diff)
downloadlibgd-e20413bf6b872a8c23f1704a89295c5897347c9d.tar.gz
- apply same CS everywhere
Diffstat (limited to 'src/pngtogd.c')
-rw-r--r--src/pngtogd.c60
1 files changed, 28 insertions, 32 deletions
diff --git a/src/pngtogd.c b/src/pngtogd.c
index 0d56bd8..cc9094a 100644
--- a/src/pngtogd.c
+++ b/src/pngtogd.c
@@ -15,40 +15,36 @@
int
main (int argc, char **argv)
{
- gdImagePtr im;
- FILE *in, *out;
- if (argc != 3)
- {
- fprintf (stderr, "Usage: pngtogd filename.png filename.gd\n");
- exit (1);
- }
- in = fopen (argv[1], "rb");
- if (!in)
- {
- fprintf (stderr, "Input file does not exist!\n");
- exit (1);
- }
+ gdImagePtr im;
+ FILE *in, *out;
+ if (argc != 3) {
+ fprintf (stderr, "Usage: pngtogd filename.png filename.gd\n");
+ exit (1);
+ }
+ in = fopen (argv[1], "rb");
+ if (!in) {
+ fprintf (stderr, "Input file does not exist!\n");
+ exit (1);
+ }
#ifdef HAVE_LIBPNG
- im = gdImageCreateFromPng (in);
+ im = gdImageCreateFromPng (in);
#else
- fprintf (stderr, "No PNG library support available.\n");
+ fprintf (stderr, "No PNG library support available.\n");
#endif
- fclose (in);
- if (!im)
- {
- fprintf (stderr, "Input is not in PNG format!\n");
- exit (1);
- }
- out = fopen (argv[2], "wb");
- if (!out)
- {
- fprintf (stderr, "Output file cannot be written to!\n");
- gdImageDestroy (im);
- exit (1);
- }
- gdImageGd (im, out);
- fclose (out);
- gdImageDestroy (im);
+ fclose (in);
+ if (!im) {
+ fprintf (stderr, "Input is not in PNG format!\n");
+ exit (1);
+ }
+ out = fopen (argv[2], "wb");
+ if (!out) {
+ fprintf (stderr, "Output file cannot be written to!\n");
+ gdImageDestroy (im);
+ exit (1);
+ }
+ gdImageGd (im, out);
+ fclose (out);
+ gdImageDestroy (im);
- return 0;
+ return 0;
}