syslog

Edwin Groothuis edwin at mavetju.org
Sat Jan 3 13:47:38 PST 2004


On Sun, Jan 04, 2004 at 02:15:18AM +0700, Eugene Grosbein wrote:
> Hi!
> 
> ache at freebsd.org wrote 8 years ago in src/lib/libc/gen/syslog.c:
> 
> p += sprintf(p, "%.15s ", ctime(&now) + 4);
> 
> What is '+ 4' for?

ctime() returns:
	Thu Nov 24 18:22:48 1986\n\0

So ctime()+4 returns:
	Nov 24 18:22:48 1986\n\0

In other words, it skips the day of the week.

Edwin

-- 
Edwin Groothuis      |            Personal website: http://www.mavetju.org
edwin at mavetju.org    |          Weblog: http://weblog.barnet.com.au/edwin/


More information about the freebsd-hackers mailing list