aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--slock.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/slock.c b/slock.c
index 506231e..aedee2e 100644
--- a/slock.c
+++ b/slock.c
@@ -75,7 +75,7 @@ getpw(void) { /* only run as root */
75 rval = pw->pw_passwd; 75 rval = pw->pw_passwd;
76 76
77#if HAVE_SHADOW_H 77#if HAVE_SHADOW_H
78 if (strlen(rval) >= 1) { /* kludge, assumes pw placeholder entry has len >= 1 */ 78 if (rval[0] == 'x' && rval[1] == '\0') {
79 struct spwd *sp; 79 struct spwd *sp;
80 sp = getspnam(getenv("USER")); 80 sp = getspnam(getenv("USER"));
81 if(!sp) 81 if(!sp)
@@ -147,7 +147,7 @@ readpw(Display *dpy, const char *pws)
147 --len; 147 --len;
148 break; 148 break;
149 default: 149 default:
150 if(num && !iscntrl((int) buf[0]) && (len + num < sizeof passwd)) { 150 if(num && !iscntrl((int) buf[0]) && (len + num < sizeof passwd)) {
151 memcpy(passwd + len, buf, num); 151 memcpy(passwd + len, buf, num);
152 len += num; 152 len += num;
153 } 153 }