* grub-core/kern/emu/hostfs.c (is_dir): Remove variable length arrays.

This commit is contained in:
Vladimir Serbinenko 2013-11-29 05:52:20 +01:00
parent 621e167fd6
commit eec893ae49
2 changed files with 9 additions and 2 deletions

View file

@ -1,3 +1,7 @@
2013-11-29 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/kern/emu/hostfs.c (is_dir): Remove variable length arrays.
2013-11-29 Vladimir Serbinenko <phcoder@gmail.com> 2013-11-29 Vladimir Serbinenko <phcoder@gmail.com>
* util/grub-fstest.c: Remove variable length arrays. * util/grub-fstest.c: Remove variable length arrays.

View file

@ -39,8 +39,9 @@ is_dir (const char *path, const char *name)
{ {
int len1 = strlen(path); int len1 = strlen(path);
int len2 = strlen(name); int len2 = strlen(name);
int ret;
char pathname[len1 + 1 + len2 + 1 + 13]; char *pathname = xmalloc (len1 + 1 + len2 + 1 + 13);
strcpy (pathname, path); strcpy (pathname, path);
/* Avoid UNC-path "//name" on Cygwin. */ /* Avoid UNC-path "//name" on Cygwin. */
@ -49,7 +50,9 @@ is_dir (const char *path, const char *name)
strcat (pathname, name); strcat (pathname, name);
return grub_util_is_directory (pathname); ret = grub_util_is_directory (pathname);
free (pathname);
return ret;
} }
struct grub_hostfs_data struct grub_hostfs_data