Changeset View
Changeset View
Standalone View
Standalone View
contrib/tcp_wrappers/percent_m.c
Show All 13 Lines | |||||
#ifndef SYS_ERRLIST_DEFINED | #ifndef SYS_ERRLIST_DEFINED | ||||
extern char *sys_errlist[]; | extern char *sys_errlist[]; | ||||
extern int sys_nerr; | extern int sys_nerr; | ||||
#endif | #endif | ||||
#include "mystdarg.h" | #include "mystdarg.h" | ||||
char *percent_m(obuf, ibuf) | char *percent_m(char *obuf, char *ibuf) | ||||
char *obuf; | |||||
char *ibuf; | |||||
{ | { | ||||
char *bp = obuf; | char *bp = obuf; | ||||
char *cp = ibuf; | char *cp = ibuf; | ||||
while (*bp = *cp) | while (*bp = *cp) | ||||
if (*cp == '%' && cp[1] == 'm') { | if (*cp == '%' && cp[1] == 'm') { | ||||
if (errno < sys_nerr && errno > 0) { | if (errno < sys_nerr && errno > 0) { | ||||
strcpy(bp, sys_errlist[errno]); | strcpy(bp, sys_errlist[errno]); | ||||
Show All 10 Lines |