From: handa Date: Mon, 13 Sep 2010 07:34:11 +0000 (+0000) Subject: (main): Fix checking number of arguments. X-Git-Tag: REL-0-9-12~5 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=29a1c65a137ed4685ede585c6fb1eb7362910e02;p=m17n%2Flibotf.git (main): Fix checking number of arguments. --- diff --git a/example/otftobdf.c b/example/otftobdf.c index 3eac593..9ea49ba 100644 --- a/example/otftobdf.c +++ b/example/otftobdf.c @@ -77,7 +77,7 @@ dump_image (int pixel_size, int index, int code, int full) unsigned char *buf; FT_GlyphSlot glyph; int dwidth, x, y; - + if (err) return; glyph = face->glyph; @@ -124,7 +124,7 @@ main (int argc, char **argv) char *filename; int platform_id, encoding_id; - if (argc < 1) + if (argc <= 1) FATAL_ERROR ("Usage: %s ENCODING OTF-FILE\n", argv[0]); if (sscanf (argv[1], "%d-%d", &platform_id, &encoding_id) != 2) { @@ -133,7 +133,7 @@ main (int argc, char **argv) } else filename = argv[2]; - + if ((err = FT_Init_FreeType (&library))) FATAL_ERROR ("%s\n", "FT_Init_FreeType: error"); err = FT_New_Face (library, filename, 0, &face);