From: Dongwoo Lee Date: Mon, 30 Aug 2021 00:46:21 +0000 (+0900) Subject: pass: thermal: Fix build warning X-Git-Tag: submit/tizen/20210830.024411^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1ee862602764f90cca7ae82b3bb1a136b5934dd9;p=platform%2Fcore%2Fsystem%2Fpass.git pass: thermal: Fix build warning Since the third agrument of strncpy means maximum permitted size of destination, using length of source string cause warning as like "specified bound depends on the length of the source argument". This fixes warning to use NAME_MAX instead of source length. Change-Id: I07399700ea454100ca0924c93eca6a99cb54b8cd Signed-off-by: Dongwoo Lee --- diff --git a/src/thermal/thermal.c b/src/thermal/thermal.c index 06b0d65..ae6c7f9 100644 --- a/src/thermal/thermal.c +++ b/src/thermal/thermal.c @@ -304,7 +304,7 @@ static int thermal_handle_notifier_data(struct device_notifier_thermal_data *dat } if (entry) { - strncpy(entry->scenario, data->scenario, strlen(data->scenario) + 1); + strncpy(entry->scenario, data->scenario, NAME_MAX); } else { entry = malloc(sizeof(*data)); if (!entry)