Hi,
Oh, I just come up with a better way to do this:
typedef char grub_password_t[1024];
int
grub_auth_strcmp (const grub_password_t s1, const grub_password_t s2)
{
char r1 = 0;
char r2 = 0;
char *p;
int i, c;
p = &r1;
c = 0;
for (i = 0; i < sizeof (grub_password_t); i++, s1++, s2++)
{
*p | = (*s1 ^ *s2);
if ((int) *s1 == c)
{
p = &r2;
c = 0x100;
}
}
return (r1 != 0);
}
The condition (int) *s1 == c would be true exactly once.
--
Bean
My repository: https://launchpad.net/burg
Document: https://help.ubuntu.com/community/Burg
_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel