diff options
author | Minje Ahn <minje.ahn@samsung.com> | 2017-07-26 10:20:13 +0900 |
---|---|---|
committer | Minje ahn <minje.ahn@samsung.com> | 2017-07-26 01:24:36 +0000 |
commit | b0829bbb865abf03ac13f4357bf72698c94308f1 (patch) | |
tree | e57a9ec8339da2c910d1aa9ec77dbba1f73d1150 /src/common/media-svc-util.c | |
parent | 9d1096758dc2099480d502b7bb2e604e3d3c2e5d (diff) | |
download | libmedia-service-b0829bbb865abf03ac13f4357bf72698c94308f1.tar.gz libmedia-service-b0829bbb865abf03ac13f4357bf72698c94308f1.tar.bz2 libmedia-service-b0829bbb865abf03ac13f4357bf72698c94308f1.zip |
Remove _strncpy_safe()
Use g_strlcpy instead of _strncpy_safe
Change-Id: I3e64ffcbd590177b320dda75e1d70c9e1cc81089
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
Diffstat (limited to 'src/common/media-svc-util.c')
-rwxr-xr-x | src/common/media-svc-util.c | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/src/common/media-svc-util.c b/src/common/media-svc-util.c index a6a16aa..a305717 100755 --- a/src/common/media-svc-util.c +++ b/src/common/media-svc-util.c @@ -147,22 +147,6 @@ RETRY_GEN: return uuid_unparsed; } -void _strncpy_safe(char *x_dst, const char *x_src, int max_len) -{ - if (!x_src || strlen(x_src) == 0) { - media_svc_error("x_src is NULL"); - return; - } - - if (max_len < 1) { - media_svc_error("length is Wrong"); - return; - } - - strncpy(x_dst, x_src, max_len - 1); - x_dst[max_len - 1] = '\0'; -} - static int __media_svc_split_to_double(char *input, double *arr) { char tmp_arr[255] = {0, }; @@ -469,7 +453,7 @@ static bool __media_svc_get_file_ext(const char *file_path, char *file_ext) for (i = strlen(file_path); i >= 0; i--) { if (file_path[i] == '.') { - _strncpy_safe(file_ext, &file_path[i + 1], MEDIA_SVC_FILE_EXT_LEN_MAX); + SAFE_STRLCPY(file_ext, &file_path[i + 1], MEDIA_SVC_FILE_EXT_LEN_MAX); return true; } @@ -980,7 +964,7 @@ int _media_svc_get_thumbnail_path(media_svc_storage_type_e storage_type, char *t } snprintf(savename, sizeof(savename), "%s/.%s-%s.%s", thumb_dir, file_ext, hash, thumbfile_ext); - _strncpy_safe(thumb_path, savename, MEDIA_SVC_PATHNAME_SIZE); + SAFE_STRLCPY(thumb_path, savename, MEDIA_SVC_PATHNAME_SIZE); /*media_svc_debug("thumb_path is [%s]", thumb_path); */ SAFE_FREE(internal_thumb_path); |