Xinqi Bao's Git
projects
/
slock.git
/ commitdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
patch
|
inline
| side by side (from parent 1:
b1289f3
)
consistently use () with sizeof
author
Markus Teich <
[email protected]
>
Fri, 8 May 2015 14:43:13 +0000
(16:43 +0200)
committer
Markus Teich <
[email protected]
>
Fri, 8 May 2015 14:44:18 +0000
(16:44 +0200)
slock.c
patch
|
blob
|
history
diff --git
a/slock.c
b/slock.c
index
1551a9e
..
68e813f
100644
(file)
--- a/
slock.c
+++ b/
slock.c
@@
-133,7
+133,7
@@
readpw(Display *dpy, const char *pws)
while (running && !XNextEvent(dpy, &ev)) {
if (ev.type == KeyPress) {
buf[0] = 0;
while (running && !XNextEvent(dpy, &ev)) {
if (ev.type == KeyPress) {
buf[0] = 0;
- num = XLookupString(&ev.xkey, buf, sizeof
buf
, &ksym, 0);
+ num = XLookupString(&ev.xkey, buf, sizeof
(buf)
, &ksym, 0);
if (IsKeypadKey(ksym)) {
if (ksym == XK_KP_Enter)
ksym = XK_Return;
if (IsKeypadKey(ksym)) {
if (ksym == XK_KP_Enter)
ksym = XK_Return;
@@
-168,7
+168,7
@@
readpw(Display *dpy, const char *pws)
--len;
break;
default:
--len;
break;
default:
- if (num && !iscntrl((int) buf[0]) && (len + num < sizeof
passwd
)) {
+ if (num && !iscntrl((int) buf[0]) && (len + num < sizeof
(passwd)
)) {
memcpy(passwd + len, buf, num);
len += num;
}
memcpy(passwd + len, buf, num);
len += num;
}