jaehyun pushed a commit to branch master.

http://git.enlightenment.org/tools/enventor.git/commit/?id=35306418304022a818a298b69f8a025c4b202c99

commit 35306418304022a818a298b69f8a025c4b202c99
Author: Jaehyun Cho <jae_hyun....@samsung.com>
Date:   Mon Mar 7 20:41:37 2016 +0900

    main: Use destination length in snprintf.
    
    Use destination length instead of source length in snprintf.
---
 src/bin/main.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/bin/main.c b/src/bin/main.c
index b53e3a8..e23e8ab 100644
--- a/src/bin/main.c
+++ b/src/bin/main.c
@@ -224,7 +224,8 @@ static void
 args_dispatch(int argc, char **argv, char *edc_path, char *edj_path,
               Eina_List **img_path, Eina_List **snd_path,
               Eina_List **fnt_path, Eina_List **dat_path,
-              Eina_Bool *default_edc, Eina_Bool *template)
+              Eina_Bool *default_edc, Eina_Bool *template,
+              int path_size)
 {
 
    Eina_List *id = NULL;
@@ -283,12 +284,12 @@ args_dispatch(int argc, char **argv, char *edc_path, char 
*edj_path,
      {
         if (strstr(argv[i], ".edc"))
           {
-             snprintf(edc_path, strlen(argv[i]), "%s", argv[i]);
+             snprintf(edc_path, path_size, "%s", argv[i]);
              *default_edc = EINA_FALSE;
           }
         else if (strstr(argv[i], ".edj"))
           {
-             snprintf(edj_path, strlen(argv[i]), "%s", argv[i]);
+             snprintf(edj_path, path_size, "%s", argv[i]);
           }
      }
 
@@ -305,7 +306,7 @@ defaults:
      {
         Eina_Tmpstr *tmp_path;
         eina_file_mkstemp(DEFAULT_EDC_FORMAT, &tmp_path);
-        snprintf(edc_path, strlen(tmp_path), "%s", (const char *)tmp_path);
+        snprintf(edc_path, path_size, "%s", (const char *)tmp_path);
         eina_tmpstr_del(tmp_path);
      }
 
@@ -352,7 +353,7 @@ config_data_set(app_data *ad, int argc, char **argv, 
Eina_Bool *default_edc,
    Eina_List *dat_path = NULL;
 
    args_dispatch(argc, argv, edc_path, edj_path, &img_path, &snd_path,
-                 &fnt_path, &dat_path, default_edc, template);
+                 &fnt_path, &dat_path, default_edc, template, PATH_MAX);
    if (!config_init(edc_path, edj_path, img_path, snd_path, fnt_path, 
dat_path))
      return EINA_FALSE;
    config_update_cb_set(config_update_cb, ad);

-- 


Reply via email to