summaryrefslogtreecommitdiff
path: root/gallery-utils.c
diff options
context:
space:
mode:
authorTomas Bzatek <tbzatek@users.sourceforge.net>2008-12-28 19:37:44 +0100
committerTomas Bzatek <tbzatek@users.sourceforge.net>2008-12-28 19:37:44 +0100
commit9d50015682975f1f70e22b4814fe7bf200c60679 (patch)
treeff02bb06fbeeb0e4945d6b42a01edbbfd73326b2 /gallery-utils.c
parentad67f341ecec4b56dca28181b570036a1095ded6 (diff)
downloadcataract-9d50015682975f1f70e22b4814fe7bf200c60679.tar.xz
Preload next image
(active by default)
Diffstat (limited to 'gallery-utils.c')
-rw-r--r--gallery-utils.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/gallery-utils.c b/gallery-utils.c
index a11273b..9642116 100644
--- a/gallery-utils.c
+++ b/gallery-utils.c
@@ -68,8 +68,7 @@ str_replace (char **dst, const char *search, const char *replace, const char *ex
/* TODO: add range checking */
- if (strstr (*dst, search) == NULL || strlen (*dst) == 0 ||
- strlen (search) == 0 || strlen (replace) == 0)
+ if (strstr (*dst, search) == NULL || strlen (*dst) == 0 || strlen (search) == 0)
return;
i = 0;
@@ -84,8 +83,10 @@ str_replace (char **dst, const char *search, const char *replace, const char *ex
}
/* copy replace string instead */
- memcpy (&d[i], replace, strlen (replace));
- i += strlen (replace);
+ if (strlen (replace) > 0) {
+ memcpy (&d[i], replace, strlen (replace));
+ i += strlen (replace);
+ }
src = found + strlen (search);
}