patch-percent_m_c 762 B

123456789101112131415161718192021222324252627
  1. --- tcp_wrappers_7.6.orig/percent_m.c 1994-12-28 17:42:37.000000000 +0100
  2. +++ tcp_wrappers_7.6/percent_m.c 2009-06-05 18:45:03.000000000 +0200
  3. @@ -13,7 +13,7 @@ static char sccsid[] = "@(#) percent_m.c
  4. #include <string.h>
  5. extern int errno;
  6. -#ifndef SYS_ERRLIST_DEFINED
  7. +#if !defined(SYS_ERRLIST_DEFINED) && !defined(HAVE_STRERROR)
  8. extern char *sys_errlist[];
  9. extern int sys_nerr;
  10. #endif
  11. @@ -29,11 +29,15 @@ char *ibuf;
  12. while (*bp = *cp)
  13. if (*cp == '%' && cp[1] == 'm') {
  14. +#ifdef HAVE_STRERROR
  15. + strcpy(bp, strerror(errno));
  16. +#else
  17. if (errno < sys_nerr && errno > 0) {
  18. strcpy(bp, sys_errlist[errno]);
  19. } else {
  20. sprintf(bp, "Unknown error %d", errno);
  21. }
  22. +#endif
  23. bp += strlen(bp);
  24. cp += 2;
  25. } else {