~kris/suckless

slock

433e9618820375b603f46c272ee2ca4740c8100f — Stein Gunnar Bakkeby 1 year, 15 days ago 06e06a1 + 04bb6dc
Merge pull request #12 from veltza/fix-controlclear

Prevent the control clear patch from blocking ctrl-u
1 files changed, 2 insertions(+), 4 deletions(-)

M slock.c
M slock.c => slock.c +2 -4
@@ 393,13 393,11 @@ readpw(Display *dpy, struct xrandr *rr, struct lock **locks, int nscreens,
			#endif // MEDIAKEYS_PATCH
			default:
				#if CONTROLCLEAR_PATCH
				if (controlkeyclear && iscntrl((int)buf[0]))
				if (controlkeyclear && iscntrl((int)buf[0]) && !num)
					continue;
				if (num && (len + num < sizeof(passwd)))
				#else
				#endif // CONTROLCLEAR_PATCH
				if (num && !iscntrl((int)buf[0]) &&
				    (len + num < sizeof(passwd)))
				#endif // CONTROLCLEAR_PATCH
				{
					memcpy(passwd + len, buf, num);
					len += num;