summaryrefslogtreecommitdiff
path: root/src/gallery-utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallery-utils.c')
-rw-r--r--src/gallery-utils.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gallery-utils.c b/src/gallery-utils.c
index b7593fe..63744b9 100644
--- a/src/gallery-utils.c
+++ b/src/gallery-utils.c
@@ -151,11 +151,14 @@ copy_file (const char *src, const char *dst)
* - returns newly allocated string
*/
char *
-make_string (const char* substr, const int count)
+make_string (const char* substr, int count)
{
int i;
char *s;
+ if (count < 0)
+ count = 0;
+
s = malloc (strlen (substr) * count + 1);
for (i = 0; i < count; i++)
memcpy (s + (strlen (substr) * i), substr, strlen (substr));