source: trunk/toolchain/gcc/patches/4.6.1/305-libmudflap-susv3-legacy.patch @ 27333

Last change on this file since 27333 was 27333, checked in by kaloz, 5 years ago

[toolchain]: replace gcc 4.5.2 support with 4.6.1

File size: 1.4 KB
  • libmudflap/mf-hooks2.c

    a b WRAPPER2(void, bzero, void *s, size_t n) 
    421421{ 
    422422  TRACE ("%s\n", __PRETTY_FUNCTION__); 
    423423  MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region"); 
    424   bzero (s, n); 
     424  memset (s, 0, n); 
    425425} 
    426426 
    427427 
    WRAPPER2(void, bcopy, const void *src, v 
    431431  TRACE ("%s\n", __PRETTY_FUNCTION__); 
    432432  MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src"); 
    433433  MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest"); 
    434   bcopy (src, dest, n); 
     434  memmove (dest, src, n); 
    435435} 
    436436 
    437437 
    WRAPPER2(int, bcmp, const void *s1, cons 
    441441  TRACE ("%s\n", __PRETTY_FUNCTION__); 
    442442  MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg"); 
    443443  MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg"); 
    444   return bcmp (s1, s2, n); 
     444  return n == 0 ? 0 : memcmp (s1, s2, n); 
    445445} 
    446446 
    447447 
    WRAPPER2(char *, index, const char *s, i 
    450450  size_t n = strlen (s); 
    451451  TRACE ("%s\n", __PRETTY_FUNCTION__); 
    452452  MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region"); 
    453   return index (s, c); 
     453  return strchr (s, c); 
    454454} 
    455455 
    456456 
    WRAPPER2(char *, rindex, const char *s, 
    459459  size_t n = strlen (s); 
    460460  TRACE ("%s\n", __PRETTY_FUNCTION__); 
    461461  MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region"); 
    462   return rindex (s, c); 
     462  return strrchr (s, c); 
    463463} 
    464464 
    465465/* XXX:  stpcpy, memccpy */ 
Note: See TracBrowser for help on using the repository browser.