"Hitoshi Ozeki" <[EMAIL PROTECTED]> writes:

> At first, When we use the 'strcmp' for the purpose of comparision C-strings,
> It requires to terminate with the NIL sentry('\0').
>
> ----begin-------------------------------
> grub_ufs_find_file (struct grub_ufs_data *data, const char *path)
> {
>   char fpath[grub_strlen (path)];  <-- not enough.
>   char *name = fpath;
>   char *next;
>   unsigned int pos = 0;
>   int dirino;
>   
>   grub_strncpy (fpath, path, grub_strlen (path));   <--without NIL.
> ----end---------------------------------

It feels easier to just add +1 at both the location.  Can anyone else
comment on this, please?

> The '.label' should set to 0.
> On the original code, The 'label' function returns the invalid pointer,
> so the 'ls -l' command gets wrong.

Marco?

~j

Attachment: pgpOs6M3jgduy.pgp
Description: PGP signature

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to