l += n < m ? n : m;
l += n < m ? n : m - 1;
void log_d(const char *fmt, ...){	va_list ap;	char log_line[1000];	int m, n, saved_errno;	char *ti;	size_t l;	if (error_file == -1 && am_daemon)		return;	va_start(ap, fmt);	saved_errno = errno;	ti = ctime(&current_time);	l = sprintf(log_line, "%.24s [%d] ", ti, my_pid);	m = sizeof log_line - l - 1;	n = vsnprintf(log_line + l, m, fmt, ap);	l += n < m ? n : m;	log_line[l++] = '\n';	write(error_file, log_line, l);	if (am_daemon == 0 && forked == 0)		write(2, log_line, l);	errno = saved_errno;	va_end(ap);}