diff options
| author | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2008-12-28 19:37:44 +0100 |
|---|---|---|
| committer | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2008-12-28 19:37:44 +0100 |
| commit | 9d50015682975f1f70e22b4814fe7bf200c60679 (patch) | |
| tree | ff02bb06fbeeb0e4945d6b42a01edbbfd73326b2 /gallery-utils.c | |
| parent | ad67f341ecec4b56dca28181b570036a1095ded6 (diff) | |
| download | cataract-9d50015682975f1f70e22b4814fe7bf200c60679.tar.xz | |
Preload next image
(active by default)
Diffstat (limited to 'gallery-utils.c')
| -rw-r--r-- | gallery-utils.c | 9 |
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); } |
