Ignore:
Timestamp:
Sep 18, 2006, 9:11:43 AM (13 years ago)
Author:
Sam Hocevar
Message:
  • Fixed memcmp() prototype and implementation.
Location:
libcaca/trunk/kernel
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/kernel/kernel.c

    r1052 r1053  
    176176}
    177177
    178 int memcmp(const char *s1, const char *s2, size_t n)
    179 {
     178int memcmp(const void *_s1, const void *_s2, size_t n)
     179{
     180    unsigned char const *s1 = _s1, *s2 = _s2;
     181
    180182    while(n--)
    181183    {
    182184        if(*s1 != *s2)
    183             return *s1 - *s2;
    184         *s1++;
    185         *s2++;
     185            return (int)*s1 - (int)*s2;
     186        s1++;
     187        s2++;
    186188    }
    187189    return 0;
  • libcaca/trunk/kernel/kernel.h

    r1052 r1053  
    8686size_t strlen(const char *s);
    8787int strcasecmp(const char *s1, const char *s2);
    88 int memcmp(const char *s1, const char *s2, size_t n);
     88int memcmp(const void *s1, const void *s2, size_t n);
     89
    8990/* stdarg.h functions */
    9091typedef void * va_list;
Note: See TracChangeset for help on using the changeset viewer.