summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lib/elementary/efl_ui_win.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c
index 47881cd3cd..63f3957dd5 100644
--- a/src/lib/elementary/efl_ui_win.c
+++ b/src/lib/elementary/efl_ui_win.c
@@ -651,11 +651,14 @@ _shot_file_get(Efl_Ui_Win_Data *sd)
651 { 651 {
652 size_t size = sizeof(char) * (strlen(tmp) + 16); 652 size_t size = sizeof(char) * (strlen(tmp) + 16);
653 repname = malloc(size); 653 repname = malloc(size);
654 strncpy(repname, tmp, dotptr - tmp); 654 if (repname)
655 snprintf(repname + (dotptr - tmp), size - 655 {
656 (dotptr - tmp), "%03i", 656 strncpy(repname, tmp, dotptr - tmp);
657 sd->shot.shot_counter + 1); 657 snprintf(repname + (dotptr - tmp), size -
658 strcat(repname, dotptr); 658 (dotptr - tmp), "%03i",
659 sd->shot.shot_counter + 1);
660 strcat(repname, dotptr);
661 }
659 free(tmp); 662 free(tmp);
660 return repname; 663 return repname;
661 } 664 }
@@ -666,6 +669,7 @@ _shot_file_get(Efl_Ui_Win_Data *sd)
666 if (!sd->shot.repeat_count) return strdup("out.png"); 669 if (!sd->shot.repeat_count) return strdup("out.png");
667 670
668 repname = malloc(sizeof(char) * 24); 671 repname = malloc(sizeof(char) * 24);
672 if (!repname) return NULL;
669 snprintf(repname, sizeof(char) * 24, "out%03i.png", 673 snprintf(repname, sizeof(char) * 24, "out%03i.png",
670 sd->shot.shot_counter + 1); 674 sd->shot.shot_counter + 1);
671 675