[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: New grub suitable for Etch



Hi Marc

I decided to use another aproach and saw that there was a mistake,  
Len Sorensen sent to mailing list some suggestions and one of then was to 
change this piece of code. Now we are reusing the buf reather than 
memcpy`ing, in fact, buf didn`t even have any memory malloc`d.

This change was roughly tested and as far as I can see does not have any 
side-effects.

On Monday 15 January 2007 18:13, Otavio Salvador wrote:
> Marc 'HE' Brockschmidt <he@ftwca.de> writes:
> > Hi,
> >
> > Otavio Salvador <otavio@debian.org> writes:
> >> @@ -139,17 +143,16 @@
> >>  +      {
> >>  +       int f_len = grub_strlen(buf) - grub_strlen(tmp);
> >>  +       char *def;
> >> -+       int a;
> >> -+       for(a = 0; a < f_len; a++)
> >> -+         grub_memcpy(&def[a], &buf[a], sizeof(char));
> >> ++       buf[f_len] = '\0';
> >> ++       def = buf;
> >>  +       safe_parse_maxint (&def, &entryno);
> >>  +      }
> >
> > I'm a bit confused by this part of the diff. I don't know what
> > grub_memcpy does exactly, but I guess it's roughly doing what memcpy
> > does. In that case, the new version is a significant change, are you
> > sure there are no side-effects?
>
> Leandro was the guy who ported this code to 0.97 and is the most
> experienced one on this part of code. I've added him on Cc and hope he
> comments on it.
>
> I wasn't the person who did this change. Leandro, can you comment on
> this change?



Reply to: