From 25fe6f034919f2a525adb3ea7e67ab4cf80816d1 Mon Sep 17 00:00:00 2001 From: okuji Date: Fri, 28 Oct 2005 03:14:33 +0000 Subject: [PATCH] 2005-10-28 Yoshinori K. Okuji From Timothy Baldwin: * commands/ls.c (grub_ls_list_files): Close FILE with grub_file_close. * kern/misc.c (grub_vsprintf): Terminate the string S with NUL. --- ChangeLog | 7 +++++++ commands/ls.c | 2 +- kern/misc.c | 3 ++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index e98a52394..26848f591 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2005-10-28 Yoshinori K. Okuji + + From Timothy Baldwin: + * commands/ls.c (grub_ls_list_files): Close FILE with + grub_file_close. + * kern/misc.c (grub_vsprintf): Terminate the string S with NUL. + 2005-10-24 Marco Gerards * include/grub/parser.h: New file. diff --git a/commands/ls.c b/commands/ls.c index 51c8fef0c..96ac299a1 100644 --- a/commands/ls.c +++ b/commands/ls.c @@ -130,7 +130,7 @@ grub_ls_list_files (char *dirname, int longlist, int all, int human) grub_printf ("%-12d", file->size); } - (fs->close) (file); + grub_file_close (file); } else grub_printf ("%-12s", "DIR"); diff --git a/kern/misc.c b/kern/misc.c index 6ae2275b9..3176f29e6 100644 --- a/kern/misc.c +++ b/kern/misc.c @@ -577,8 +577,9 @@ grub_vsprintf (char *str, const char *fmt, va_list args) if (p > fmt) { - char s[p - fmt]; + char s[p - fmt + 1]; grub_strncpy (s, fmt, p - fmt); + s[p - fmt] = 0; if (s[0] == '0') zerofill = '0'; format1 = grub_strtoul (s, 0, 10);