summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Michael <cpmichael1@comcast.net>2011-10-27 18:54:18 +0000
committerChristopher Michael <cpmichael1@comcast.net>2011-10-27 18:54:18 +0000
commit8a56090bb41ea56e60f757941a7f277a4bea5b5f (patch)
treea2341c08f640aab3c596c81f426fe25e6a7155b1
parenta5a60a3ef28fc87889b320159ac27a7a9f2cda96 (diff)
Emprint: Better check against double extension in filename.
SVN revision: 64443
-rw-r--r--src/bin/main.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/bin/main.c b/src/bin/main.c
index 5103bfc..41b6198 100644
--- a/src/bin/main.c
+++ b/src/bin/main.c
@@ -323,8 +323,13 @@ _em_get_filename(void)
323 else 323 else
324 snprintf(buf, sizeof(buf), "%s/%s%s", dir, file, ext); 324 snprintf(buf, sizeof(buf), "%s/%s%s", dir, file, ext);
325 } 325 }
326 else 326 else
327 snprintf(buf, sizeof(buf), "%s/%s", dir, file); 327 {
328 if (!strrchr(file, '.'))
329 snprintf(buf, sizeof(buf), "%s/%s.png", dir, file);
330 else
331 snprintf(buf, sizeof(buf), "%s/%s", dir, file);
332 }
328 } 333 }
329 } 334 }
330 335