aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/unifdef.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/scripts/unifdef.c b/scripts/unifdef.c
index 5384b4377333..552025e72acb 100644
--- a/scripts/unifdef.c
+++ b/scripts/unifdef.c
@@ -450,7 +450,14 @@ ignoreon(void)
450static void 450static void
451keywordedit(const char *replacement) 451keywordedit(const char *replacement)
452{ 452{
453 strlcpy(keyword, replacement, tline + sizeof(tline) - keyword); 453 size_t size = tline + sizeof(tline) - keyword;
454 char *dst = keyword;
455 const char *src = replacement;
456 if (size != 0) {
457 while ((--size != 0) && (*src != '\0'))
458 *dst++ = *src++;
459 *dst = '\0';
460 }
454 print(); 461 print();
455} 462}
456static void 463static void