]> git.ipfire.org Git - thirdparty/coreutils.git/commit
pinky,who: fix bug in latest change
authorJim Meyering <meyering@redhat.com>
Sun, 15 Jul 2012 16:18:03 +0000 (18:18 +0200)
committerJim Meyering <meyering@redhat.com>
Sun, 15 Jul 2012 17:11:45 +0000 (19:11 +0200)
commitac00d23e1a90dc5a8cd0f6de0e61eb401d5089d5
treee94876b4676c65ad8b8fa84d9f5d7320944ba5df
parente380221333f4efd8d49b29b2690375c36eb90505
pinky,who: fix bug in latest change

* src/system.h (stzncpy): New function.
* src/pinky.c (print_entry): Use stzncpy, not stpncpy.
The latter does not NUL-terminate.  I assumed that strncpy was
the only function with such a horrible API.  Today I learned that
stpncpy also may not NUL-terminate its result.
The bugs were introduced in commit v8.17-48-gf79263d.
* src/who.c (print_user): Likewise.
Thanks to Erik Auerswald for spotting my error.
src/pinky.c
src/system.h
src/who.c