diff options
-rw-r--r-- | kexec/fs2dt.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/kexec/fs2dt.c b/kexec/fs2dt.c index 73c1fb9..5e6b98d 100644 --- a/kexec/fs2dt.c +++ b/kexec/fs2dt.c @@ -619,8 +619,7 @@ static void putnode(void) * code can print 'I'm in purgatory' message. Currently only * pseries/hvcterminal is supported. */ - strcpy(filename, pathname); - strncat(filename, "linux,stdout-path", MAXPATH); + snprintf(filename, MAXPATH, "%slinux,stdout-path", pathname); fd = open(filename, O_RDONLY); if (fd == -1) { printf("Unable to find %s, printing from purgatory is diabled\n", @@ -648,9 +647,7 @@ static void putnode(void) filename); goto no_debug; } - strncpy(filename, "/proc/device-tree/", MAXPATH); - strncat(filename, buff, MAXPATH); - strncat(filename, "/compatible", MAXPATH); + snprintf(filename, MAXPATH, "/proc/device-tree/%s/compatible", buff); fd = open(filename, O_RDONLY); if (fd == -1) { printf("Unable to find %s printing from purgatory is diabled\n", |