JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
NUL terminate the strftime(3) buffer.
authorTiago Cunha <tcunha@gmx.com>
Thu, 2 Feb 2012 15:52:56 +0000 (15:52 +0000)
committerTiago Cunha <tcunha@gmx.com>
Tue, 7 Feb 2012 23:02:03 +0000 (23:02 +0000)
commit20f6684161c42b30f9aad3fafa4431bd3ab88fd8
treef60123fa3e747633169cd0f4c3177358bc3fc196
parent684fc5a3a6497b78a0b56129b4fcc547e3fb56fd
NUL terminate the strftime(3) buffer.

SUS says that if there wasn't enough space to copy the expanded format
to the buffer, strftime(3) will not NUL terminate it. It would work on
some implementations (eg on OpenBSD), though.

Therefore, take advantage of the return value to prevent using the
character array with unspecified contents with a very large clock
format.

Besides, the strlcat(3) call below relies on the destination buffer
being NUL terminated.

ok marco
scrotwm.c