aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Ravnborg <sam@mars.ravnborg.org>2006-07-23 14:41:30 -0400
committerSam Ravnborg <sam@neptun.ravnborg.org>2006-09-25 03:00:00 -0400
commit14a036d2dc304797f3624c06bd6d2a1e9b59e45a (patch)
tree8c35e30949dd748970cd106f5544077ed4cd4c69
parent01f1c8799ad8b23c190d59cf1c9e28e6fed390a4 (diff)
kbuild: replace use of strlcpy with a dedicated implmentation in unifdef
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
-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