summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2012-01-03 04:52:03 +0000
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>2012-01-03 04:52:03 +0000
commit4ae3b44c4598063a30bc3b27bd2234672baeab69 (patch)
tree63c8b932bab27cd32ab57e5397ad77ae50908c16 /src
parentd7fbec35e5eb2207c0f8b749c080b553d9ac1ba0 (diff)
me no likey sprintf
SVN revision: 66774
Diffstat (limited to 'src')
-rw-r--r--src/lib/elm_photo.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/lib/elm_photo.c b/src/lib/elm_photo.c
index f76ae43c9..6955b9484 100644
--- a/src/lib/elm_photo.c
+++ b/src/lib/elm_photo.c
@@ -175,7 +175,6 @@ _longpress(void *objv)
175 Widget_Data *wd = elm_widget_data_get(objv); 175 Widget_Data *wd = elm_widget_data_get(objv);
176 Evas_Object *tmp; 176 Evas_Object *tmp;
177 const char *file; 177 const char *file;
178 char *buf;
179 178
180 DBG("Long press: start drag!"); 179 DBG("Long press: start drag!");
181 wd->longtimer = NULL; /* clear: must return NULL now */ 180 wd->longtimer = NULL; /* clear: must return NULL now */
@@ -186,16 +185,15 @@ _longpress(void *objv)
186 evas_object_image_file_get(tmp,&file,NULL); 185 evas_object_image_file_get(tmp,&file,NULL);
187 if (file) 186 if (file)
188 { 187 {
189 /* FIXME: Deal with relative paths */ 188 char buf[4096 + 7];
190 buf = malloc(strlen(file) + strlen("file://") + 1); 189 /* FIXME: Deal with relative paths; use PATH_MAX */
191 sprintf(buf, "%s%s","file://",file); 190 snprintf(buf, sizeof(buf), "file://%s", file);
192 if (elm_drag_start(objv, ELM_SEL_FORMAT_IMAGE, 191 if (elm_drag_start(objv, ELM_SEL_FORMAT_IMAGE,
193 buf, _drag_done_cb, NULL)) 192 buf, _drag_done_cb, NULL))
194 { 193 {
195 elm_object_scroll_freeze_push(objv); 194 elm_object_scroll_freeze_push(objv);
196 evas_object_smart_callback_call(objv, SIG_DRAG_START, NULL); 195 evas_object_smart_callback_call(objv, SIG_DRAG_START, NULL);
197 } 196 }
198 free(buf);
199 } 197 }
200 198
201 return 0; /* Don't call again */ 199 return 0; /* Don't call again */