This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Are ut_user and ut_host in struct utmp NUL-terminated?
- From: Florian Weimer <fweimer at redhat dot com>
- To: GNU C Library <libc-alpha at sourceware dot org>, "linux-man at vger dot kernel dot org" <linux-man at vger dot kernel dot org>
- Date: Mon, 13 Aug 2018 14:10:52 +0200
- Subject: Are ut_user and ut_host in struct utmp NUL-terminated?
Can ut_user be exactly UT_NAMESIZE bytes long? Or is it necessary to
set aside a byte with the NUL terminator?
I'm not sure what POSIX says about struct utmpx. It never says “string”
in the context of ut_user, so I don't think it clarifies this matter.
Thanks,
Florian