Skip to content

Commit

Permalink
kbuild: replace use of strlcpy with a dedicated implmentation in unifdef
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
  • Loading branch information
Sam Ravnborg authored and Sam Ravnborg committed Sep 25, 2006
1 parent 01f1c87 commit 14a036d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion scripts/unifdef.c
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,14 @@ ignoreon(void)
static void
keywordedit(const char *replacement)
{
strlcpy(keyword, replacement, tline + sizeof(tline) - keyword);
size_t size = tline + sizeof(tline) - keyword;
char *dst = keyword;
const char *src = replacement;
if (size != 0) {
while ((--size != 0) && (*src != '\0'))
*dst++ = *src++;
*dst = '\0';
}
print();
}
static void
Expand Down

0 comments on commit 14a036d

Please sign in to comment.