/[grub]/grub2/kern/misc.c
ViewVC logotype

Diff of /grub2/kern/misc.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.20 by hollisb, Thu Jun 23 23:13:57 2005 UTC revision 1.21 by okuji, Fri Aug 12 19:53:32 2005 UTC
# Line 191  grub_strcmp (const char *s1, const char Line 191  grub_strcmp (const char *s1, const char
191  }  }
192    
193  int  int
194  grub_strncmp (const char *s1, const char *s2, int c)  grub_strncmp (const char *s1, const char *s2, grub_size_t n)
195  {  {
196    int p = 1;    if (n == 0)
197        return 0;
198    while (*s1 && *s2 && p < c)    
199      while (*s1 && *s2 && --n)
200      {      {
201        if (*s1 != *s2)        if (*s1 != *s2)
202          return (int) *s1 - (int) *s2;          return (int) *s1 - (int) *s2;
203                
204        s1++;        s1++;
205        s2++;        s2++;
       p++;  
206      }      }
207    
208    return (int) *s1 - (int) *s2;    return (int) *s1 - (int) *s2;

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.21

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26