summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--camlibs/canon/ChangeLog3
-rw-r--r--camlibs/canon/canon.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/camlibs/canon/ChangeLog b/camlibs/canon/ChangeLog
index 9cc5825f9..d8ed6cbf0 100644
--- a/camlibs/canon/ChangeLog
+++ b/camlibs/canon/ChangeLog
@@ -3,6 +3,9 @@
* canon.c: SL_THUMB_CR2 should be as large as the CR2 image,
because the thumbnail getter retrieves the whole image for some reason.
+ * canon.c: Moved a strncpy() out of a failure node, making
+ replace_filename_extension() work again.
+
2007-12-27 Daniel M German <dmg@uvic.ca>
* canon.h, library.c: More configuration values for some
diff --git a/camlibs/canon/canon.c b/camlibs/canon/canon.c
index c9bd2066f..1a13d1002 100644
--- a/camlibs/canon/canon.c
+++ b/camlibs/canon/canon.c
@@ -394,11 +394,11 @@ replace_filename_extension(const char *filename, const char __unused__ *newext)
* name of the thumbnail file.
*/
if (sizeof(buf) < strlen (filename) + 1) {
- strncpy (buf, filename, sizeof (buf) - 1);
GP_DEBUG ("replace_filename_extension: Buffer too small in %s line %i.",
__FILE__, __LINE__);
return NULL;
}
+ strncpy (buf, filename, sizeof (buf) - 1);
if ((p = strrchr (buf, '.')) == NULL) {
GP_DEBUG ("replace_filename_extension: No '.' found in filename '%s' "
"in %s line %i.", filename, __FILE__, __LINE__);