- while ((c = *f++) != '\0' && c != '\n' && b < buf + MAXLINE) {
- if (c != '%') {
- *b++ = c;
- continue;
- }
- c = *f++;
- if (c != 'm') {
- *b++ = '%', *b++ = c, *b++ = '\0';
- continue;
- }
- if ((unsigned)errno > sys_nerr)
- sprintf(b, "error %d", errno);
- else
- strcat(b, sys_errlist[errno]);
- b += strlen(b);
- }
- if (c == '\0')
- f--;
- *b++ = '\n', *b = '\0';
- sprintf(outline, buf, p0, p1, p2, p3, p4);
- errno = 0;
- if (LogStat & LOG_DGRAM)
- (void) sendto(LogFile, outline, strlen(outline), 0,
- &SyslogAddr, sizeof SyslogAddr);
+ if ((unsigned)errno > sys_nerr)
+ sprintf(b, "error %d", errno);