Print this page
1666 libwrap is 32bit only
Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
Reviewed by: Garrett D'Amore <garrett.damore@dey-sys.com>
Reviewed by: Richard Lowe <richlowe@richlowe.net>
@@ -1,11 +1,9 @@
/*
* Copyright 2001 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*
* Replace %m by system error message.
*
* Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
*/
@@ -17,14 +15,10 @@
#include <stdio.h>
#include <errno.h>
#include <string.h>
extern int errno;
-#ifndef SYS_ERRLIST_DEFINED
-extern char *sys_errlist[];
-extern int sys_nerr;
-#endif
#include "mystdarg.h"
char *percent_m(obuf, ibuf)
char *obuf;
@@ -33,15 +27,11 @@
char *bp = obuf;
char *cp = ibuf;
while (*bp = *cp)
if (*cp == '%' && cp[1] == 'm') {
- if (errno < sys_nerr && errno > 0) {
- strcpy(bp, sys_errlist[errno]);
- } else {
- sprintf(bp, "Unknown error %d", errno);
- }
+ strcpy(bp, strerror(errno));
bp += strlen(bp);
cp += 2;
} else {
bp++, cp++;
}