305-libmudflap-susv3-legacy.patch 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. --- a/libmudflap/mf-hooks2.c
  2. +++ b/libmudflap/mf-hooks2.c
  3. @@ -421,7 +421,7 @@ WRAPPER2(void, bzero, void *s, size_t n)
  4. {
  5. TRACE ("%s\n", __PRETTY_FUNCTION__);
  6. MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region");
  7. - bzero (s, n);
  8. + memset (s, 0, n);
  9. }
  10. @@ -431,7 +431,7 @@ WRAPPER2(void, bcopy, const void *src, v
  11. TRACE ("%s\n", __PRETTY_FUNCTION__);
  12. MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src");
  13. MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest");
  14. - bcopy (src, dest, n);
  15. + memmove (dest, src, n);
  16. }
  17. @@ -441,7 +441,7 @@ WRAPPER2(int, bcmp, const void *s1, cons
  18. TRACE ("%s\n", __PRETTY_FUNCTION__);
  19. MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg");
  20. MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg");
  21. - return bcmp (s1, s2, n);
  22. + return n == 0 ? 0 : memcmp (s1, s2, n);
  23. }
  24. @@ -450,7 +450,7 @@ WRAPPER2(char *, index, const char *s, i
  25. size_t n = strlen (s);
  26. TRACE ("%s\n", __PRETTY_FUNCTION__);
  27. MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region");
  28. - return index (s, c);
  29. + return strchr (s, c);
  30. }
  31. @@ -459,7 +459,7 @@ WRAPPER2(char *, rindex, const char *s,
  32. size_t n = strlen (s);
  33. TRACE ("%s\n", __PRETTY_FUNCTION__);
  34. MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region");
  35. - return rindex (s, c);
  36. + return strrchr (s, c);
  37. }
  38. /* XXX: stpcpy, memccpy */