Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 4 Jan 2004 08:47:31 +1100
From:      Edwin Groothuis <edwin@mavetju.org>
To:        Eugene Grosbein <eugen@grosbein.pp.ru>
Cc:        hackers@freebsd.org
Subject:   Re: syslog
Message-ID:  <20040103214731.GA59347@k7.mavetju>
In-Reply-To: <3FF714C6.1D099404@grosbein.pp.ru>
References:  <3FF714C6.1D099404@grosbein.pp.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Jan 04, 2004 at 02:15:18AM +0700, Eugene Grosbein wrote:
> Hi!
> 
> ache@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@mavetju.org    |          Weblog: http://weblog.barnet.com.au/edwin/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040103214731.GA59347>