From: okuji Date: Fri, 28 Oct 2005 03:14:33 +0000 (+0000) Subject: 2005-10-28 Yoshinori K. Okuji X-Git-Tag: 1.98~2047 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=25fe6f034919f2a525adb3ea7e67ab4cf80816d1;p=thirdparty%2Fgrub.git 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. --- 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);