summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@samsung.com>2014-01-24 08:17:53 +0900
committerCedric BAIL <cedric.bail@samsung.com>2014-01-24 08:19:47 +0900
commit5593964ead053d980db60ac42acf194040b85452 (patch)
treeb6753329c437b5dd5ed4d2a28e2d47f0581fdb01 /src/bin
parent0078769f133c1bbb98cb7f071a0d7c4ff4a98aef (diff)
embryo: force the insertion of a '/' in the path to be sure that file path make sense.
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/embryo/embryo_cc_sc2.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/bin/embryo/embryo_cc_sc2.c b/src/bin/embryo/embryo_cc_sc2.c
index 90e177c16a..0b72ee312a 100644
--- a/src/bin/embryo/embryo_cc_sc2.c
+++ b/src/bin/embryo/embryo_cc_sc2.c
@@ -146,10 +146,8 @@ plungefile(char *name, int try_currentpath, int try_includepaths)
146 { 146 {
147 char path[PATH_MAX]; 147 char path[PATH_MAX];
148 148
149 strncpy(path, ptr, sizeof path); 149 snprintf(path, sizeof (path), "%s/%s", ptr, name);
150 path[sizeof path - 1] = '\0'; /* force '\0' termination */ 150 path[sizeof path - 1] = '\0'; /* force '\0' termination */
151 strncat(path, name, sizeof(path) - strlen(path) - 1);
152 path[sizeof path - 1] = '\0';
153 result = plungequalifiedfile(path); 151 result = plungequalifiedfile(path);
154 } /* while */ 152 } /* while */
155 } /* if */ 153 } /* if */