diff options
author | KiseokChang <kiso.chang@samsung.com> | 2023-07-18 11:36:07 +0900 |
---|---|---|
committer | KiseokChang <kiso.chang@samsung.com> | 2023-07-18 11:37:36 +0900 |
commit | ae74b885c884770a1f2a53833651ffd479ad1ca0 (patch) | |
tree | 9fbcb867b4aaa7c100e46fb8cc8bd22ec750996d | |
parent | 02ae73c2c6ce65ba033894de5f332d74ea7e0495 (diff) | |
download | settings-tizen.tar.gz settings-tizen.tar.bz2 settings-tizen.zip |
fix warning from strndup()tizen_9.0_m2_releaseaccepted/tizen/unified/riscv/20231219.070856accepted/tizen/unified/dev/20230726.120012accepted/tizen/unified/20231219.041313accepted/tizen/9.0/unified/20241030.231401tizen_9.0tizenaccepted/tizen_unified_riscvaccepted/tizen_unified_devaccepted/tizen_unifiedaccepted/tizen_9.0_unified
- revert build option, Wno-stringop-overread
Change-Id: Ie7e526f2e8c67bd5935be720350fe48b28d3a4d4
Signed-off-by: KiseokChang <kiso.chang@samsung.com>
-rwxr-xr-x | setting-ringtone/CMakeLists.txt | 1 | ||||
-rwxr-xr-x | setting-ringtone/src/setting-ringtone-main.c | 8 |
2 files changed, 7 insertions, 2 deletions
diff --git a/setting-ringtone/CMakeLists.txt b/setting-ringtone/CMakeLists.txt index 4b94664..cd00fd3 100755 --- a/setting-ringtone/CMakeLists.txt +++ b/setting-ringtone/CMakeLists.txt @@ -35,6 +35,7 @@ ENDIF("${ARCH}" STREQUAL "arm") ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"") ADD_DEFINITIONS("-DSLP_DEBUG") ADD_DEFINITIONS("-shared") +ADD_DEFINITIONS("-Wno-stringop-overread") SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=/usr/lib") diff --git a/setting-ringtone/src/setting-ringtone-main.c b/setting-ringtone/src/setting-ringtone-main.c index 95d36fd..9706a8d 100755 --- a/setting-ringtone/src/setting-ringtone-main.c +++ b/setting-ringtone/src/setting-ringtone-main.c @@ -351,10 +351,14 @@ static char *_get_default_filepath(SettingRingtoneData *ad) if (ad->default_substitution) return strndup(ad->default_substitution, PATH_MAX); + int maxpath = sizeof(ALERT_FILE_PATH_DEF); + if(maxpath > PATH_MAX) maxpath = PATH_MAX; if (ad->show_notification) - return strndup(ALERT_FILE_PATH_DEF, PATH_MAX); + return strndup(ALERT_FILE_PATH_DEF, maxpath); - return strndup(RINGTONE_FILE_PATH_DEF, PATH_MAX); + maxpath = sizeof(RINGTONE_FILE_PATH_DEF); + if(maxpath > PATH_MAX) maxpath = PATH_MAX; + return strndup(RINGTONE_FILE_PATH_DEF, maxpath); } static void _move_more_ctxpopup(SettingRingtoneData *ad) |