aboutsummaryrefslogtreecommitdiffstats
path: root/legacy/elementary/src
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2012-01-03 05:30:13 +0000
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>2012-01-03 05:30:13 +0000
commitac529422ec5ca141dc95e8773ae0614664140cf7 (patch)
treeff11219aa27c1246f9ac23e36303f38cb53f59f8 /legacy/elementary/src
parentput notes in elm_list.c as to what to do. (diff)
downloadefl-ac529422ec5ca141dc95e8773ae0614664140cf7.tar.gz
more sprintfs
SVN revision: 66778
Diffstat (limited to 'legacy/elementary/src')
-rw-r--r--legacy/elementary/src/lib/elm_win.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/legacy/elementary/src/lib/elm_win.c b/legacy/elementary/src/lib/elm_win.c
index 8b9644b4ca..354c7b6735 100644
--- a/legacy/elementary/src/lib/elm_win.c
+++ b/legacy/elementary/src/lib/elm_win.c
@@ -144,9 +144,10 @@ _shot_file_get(Elm_Win *win)
char *dotptr = strrchr(tmp, '.');
if (dotptr)
{
- repname = malloc(sizeof(char)*(strlen(tmp) + 16));
+ size_t size = sizeof(char)*(strlen(tmp) + 16);
+ repname = malloc(size);
strncpy(repname, tmp, dotptr - tmp);
- sprintf(repname + (dotptr - tmp), "%03i",
+ snprintf(repname + (dotptr - tmp), size - (dotptr - tmp), "%03i",
win->shot.shot_counter + 1);
strcat(repname, dotptr);
free(tmp);
@@ -157,12 +158,10 @@ _shot_file_get(Elm_Win *win)
}
free(tmp);
if (!win->shot.repeat_count) return strdup("out.png");
- else
- {
- repname = malloc(sizeof(char) * 24);
- sprintf(repname, "out%03i.png", win->shot.shot_counter + 1);
- return repname;
- }
+
+ repname = malloc(sizeof(char) * 24);
+ snprintf(repname, sizeof(char) * 24, "out%03i.png", win->shot.shot_counter + 1);
+ return repname;
}
static int