From 29a1c65a137ed4685ede585c6fb1eb7362910e02 Mon Sep 17 00:00:00 2001 From: handa Date: Mon, 13 Sep 2010 07:34:11 +0000 Subject: [PATCH] (main): Fix checking number of arguments. --- example/otftobdf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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); -- 1.7.10.4