From 3f5590213020bb2c6aad4b26403b3e43d01afe22 Mon Sep 17 00:00:00 2001 From: Carlos Garcia Campos Date: Sun, 21 Sep 2008 12:46:32 +0200 Subject: [PATCH] [test/any2ppm] Use strrchr instead of strchr to get the file extension When the filename contains more than one dot we get the wrong file extension and any2ppm fails. --- test/any2ppm.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/test/any2ppm.c b/test/any2ppm.c index 5fe8b9e..bca35f3 100644 --- a/test/any2ppm.c +++ b/test/any2ppm.c @@ -352,7 +352,7 @@ convert (char **argv, int fd) const struct converter *converter = converters; char *type; - type = strchr (argv[0], '.'); + type = strrchr (argv[0], '.'); if (type == NULL) return "no file extension"; type++; -- 1.5.6.3