Fix build warning for gcc 9 83/220983/1 accepted/tizen/unified/20191227.142642 submit/tizen/20191227.083406
authorSemun Lee <semun.lee@samsung.com>
Thu, 26 Dec 2019 06:42:37 +0000 (15:42 +0900)
committerSemun Lee <semun.lee@samsung.com>
Thu, 26 Dec 2019 06:42:37 +0000 (15:42 +0900)
use stpncpy instead of snprintf for copying mcc_str

Change-Id: Ia3012b2c120a86d095a440e581f5f98526bd810e
Signed-off-by: Semun Lee <semun.lee@samsung.com>
src/time_update.c

index 529b424..8ef5303 100644 (file)
@@ -288,7 +288,7 @@ static gboolean __update_timezone(const struct tnoti_network_timeinfo *ti,
        char mcc_str[4] = {0,};
        gboolean ret = FALSE;
 
-       snprintf(mcc_str, 4, "%s", ti->plmn);
+       stpncpy(mcc_str, ti->plmn, 3);
        mcc = atoi(mcc_str);
 
        /*