From 8a01c240b881890d4849ef815edabe0296244f5f Mon Sep 17 00:00:00 2001 From: Blue Swirl Date: Sat, 13 Nov 2010 10:56:45 +0000 Subject: [PATCH] bootstrap: avoid a warning from OpenBSD linker Avoid this link time warning by using strdup(): host/kernel/bootstrap.o(.text+0x854): In function `fopen_include': ../kernel/bootstrap.c:479: warning: strcpy() is almost always misused, please use strlcpy() Signed-off-by: Blue Swirl git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@953 f158a5a8-5612-0410-a976-696ce0be7e32 --- kernel/bootstrap.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kernel/bootstrap.c b/kernel/bootstrap.c index 90c93c1..f9c417a 100644 --- a/kernel/bootstrap.c +++ b/kernel/bootstrap.c @@ -475,8 +475,7 @@ static FILE *fopen_include(const char *fil) #ifdef CONFIG_DEBUG_INTERPRETER printk("Including '%s'\n", name ); #endif - srcfilenames [ cursrc ] = malloc(strlen(fil) + 1); - strcpy(srcfilenames[ cursrc ], fil); + srcfilenames[cursrc] = strdup(fil); srclines [ cursrc ] = 1; srcfiles [ cursrc++ ] = ret;