Messages in this thread Patch in this message | | | From | Harshit Jain <> | Subject | [PATCH] scripts: unifdef: fix stringop-truncation warning | Date | Fri, 17 Aug 2018 22:20:38 +0200 |
| |
While compiling the mainline kernel in android env with latest gcc 8 the compiler threw this warning Thanks to the advantage of improved static analysis in newer gcc we are now able to see this warning this patch resolves the detected compiler warnings.
Signed-off-by: Harshit Jain <harshitjain6751@gmail.com> --- scripts/unifdef.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/unifdef.c b/scripts/unifdef.c index 7493c0ee51cc..985649805cdd 100644 --- a/scripts/unifdef.c +++ b/scripts/unifdef.c @@ -450,7 +450,7 @@ static void Idrop (void) { Fdrop(); ignoreon(); } static void Itrue (void) { Ftrue(); ignoreon(); } static void Ifalse(void) { Ffalse(); ignoreon(); } /* modify this line */ -static void Mpass (void) { strncpy(keyword, "if ", 4); Pelif(); } +static void Mpass (void) { memcpy(keyword, "if ", 4); Pelif(); } static void Mtrue (void) { keywordedit("else"); state(IS_TRUE_MIDDLE); } static void Melif (void) { keywordedit("endif"); state(IS_FALSE_TRAILER); } static void Melse (void) { keywordedit("endif"); state(IS_FALSE_ELSE); } -- 2.18.0
| |