Based on patch from BVK Chaitanya <bvk.groups@gmail.com>
* kern/misc.c (grub_strchr, grub_strrchr): Fix to handle c == '\0'
case.
+2009-11-01 Robert Millan <rmh.grub@aybabtu.com>
+
+ Based on patch from BVK Chaitanya <bvk.groups@gmail.com>
+ * kern/misc.c (grub_strchr, grub_strrchr): Fix to handle c == '\0'
+ case.
+
2009-11-01 Felix Zielcke <fzielcke@z-51.de>
* Makefile.in (TARGET_CPPFLAGS): Add `-I$(srcdir)/include'.
char *
grub_strchr (const char *s, int c)
{
- while (*s)
+ do
{
if (*s == c)
return (char *) s;
- s++;
}
+ while (*s++);
return 0;
}
char *
grub_strrchr (const char *s, int c)
{
- char *p = 0;
+ char *p = NULL;
- while (*s)
+ do
{
if (*s == c)
p = (char *) s;
- s++;
}
+ while (*s++);
return p;
}