diff options
| author | Sam Ravnborg <sam@mars.ravnborg.org> | 2006-07-23 14:41:30 -0400 |
|---|---|---|
| committer | Sam Ravnborg <sam@neptun.ravnborg.org> | 2006-09-25 03:00:00 -0400 |
| commit | 14a036d2dc304797f3624c06bd6d2a1e9b59e45a (patch) | |
| tree | 8c35e30949dd748970cd106f5544077ed4cd4c69 /scripts | |
| parent | 01f1c8799ad8b23c190d59cf1c9e28e6fed390a4 (diff) | |
kbuild: replace use of strlcpy with a dedicated implmentation in unifdef
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/unifdef.c | 9 |
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) | |||
| 450 | static void | 450 | static void |
| 451 | keywordedit(const char *replacement) | 451 | keywordedit(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 | } |
| 456 | static void | 463 | static void |
