[hackers] [ubase] Use LOGIN_NAME_MAX instead of a hardcoded value || sin

From: <git_AT_suckless.org>
Date: Tue, 11 Feb 2014 12:02:07 +0100

commit 894be72e6b9d42c9a17d7a14786f101e65e49c42
Author: sin <sin_AT_2f30.org>
Date: Tue Feb 11 10:55:38 2014 +0000

    Use LOGIN_NAME_MAX instead of a hardcoded value
    
    As far as I can tell LOGIN_NAME_MAX includes the null-terminator.

diff --git a/getty.c b/getty.c
index 6e658cd..1c8f236 100644
--- a/getty.c
+++ b/getty.c
_AT_@ -1,5 +1,6 @@
 /* See LICENSE file for copyright and license details. */
 #include <fcntl.h>
+#include <limits.h>
 #include <signal.h>
 #include <stdio.h>
 #include <stdlib.h>
_AT_@ -24,7 +25,7 @@ main(int argc, char *argv[])
 {
         int fd;
         struct sigaction sa;
- char term[128], logname[128], c;
+ char term[128], logname[LOGIN_NAME_MAX], c;
         int i = 0;
         ssize_t n;
 
Received on Tue Feb 11 2014 - 12:02:07 CET

This archive was generated by hypermail 2.3.0 : Tue Feb 11 2014 - 12:12:26 CET