diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2011-02-10 19:37:56 -0500 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2011-02-10 19:37:56 -0500 |
commit | c0f81ca42b125d9a8d9c334eeec74fa5487bfc15 (patch) | |
tree | bdab491e1cc2960055b23970db9f6ff0fdca324e | |
parent | Accept output file and write error messages to stderr. (diff) | |
download | lastlog-c0f81ca42b125d9a8d9c334eeec74fa5487bfc15.tar.xz lastlog-c0f81ca42b125d9a8d9c334eeec74fa5487bfc15.zip |
Make sure we don't write too much into ip string.
-rw-r--r-- | utmpr.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -131,7 +131,7 @@ void binary_to_text(FILE *fp) if (0) //TODO: determine how to figure out of it's an ipv6. entries 1 2 and 3 are zero perhaps? ip[0] = 'a'; //TODO: format ipv6 address else - sprintf(ip, "%d.%d.%d.%d", + sprintf(ip, "%hhu.%hhu.%hhu.%hhu", (entry.ut_addr_v6[0] >> 0x0) & 0xFF, (entry.ut_addr_v6[0] >> 0x8) & 0xFF, (entry.ut_addr_v6[0] >> 0x10) & 0xFF, |