X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=main.c;h=ce13a800536ae63bd531c352d6ce66797aedb329;hb=1026eb83089c3e79a12d2d74f3b6b01703e6f55a;hp=1d37f70d8ebe89b814680c4fff6f60f837ea9cd7;hpb=f63327677421a07cca69b86c7dd5f01047fe14b1;p=dmenu.git diff --git a/main.c b/main.c index 1d37f70..ce13a80 100644 --- a/main.c +++ b/main.c @@ -11,7 +11,6 @@ #include #include #include -#include #include #include @@ -145,7 +144,7 @@ kpress(XKeyEvent * e) { len = strlen(text); buf[0] = 0; - num = XLookupString(e, buf, sizeof(buf), &ksym, 0); + num = XLookupString(e, buf, sizeof buf, &ksym, 0); if(IsFunctionKey(ksym) || IsKeypadKey(ksym) || IsMiscFunctionKey(ksym) || IsPFKey(ksym) || IsPrivateKeypadKey(ksym)) @@ -182,7 +181,7 @@ kpress(XKeyEvent * e) { case XK_Tab: if(!sel) return; - strncpy(text, sel->text, sizeof(text)); + strncpy(text, sel->text, sizeof text); match(text); break; case XK_Right: @@ -222,9 +221,9 @@ kpress(XKeyEvent * e) { if(num && !iscntrl((int) buf[0])) { buf[num] = 0; if(len > 0) - strncat(text, buf, sizeof(text)); + strncat(text, buf, sizeof text); else - strncpy(text, buf, sizeof(text)); + strncpy(text, buf, sizeof text); match(text); } } @@ -239,7 +238,7 @@ readstdin(void) { Item *i, *new; i = 0; - while(fgets(buf, sizeof(buf), stdin)) { + while(fgets(buf, sizeof buf, stdin)) { len = strlen(buf); if (buf[len - 1] == '\n') buf[len - 1] = 0; @@ -346,7 +345,6 @@ main(int argc, char *argv[]) { DefaultDepth(dpy, screen), CopyFromParent, DefaultVisual(dpy, screen), CWOverrideRedirect | CWBackPixmap | CWEventMask, &wa); - XDefineCursor(dpy, win, XCreateFontCursor(dpy, XC_xterm)); /* pixmap */ dc.drawable = XCreatePixmap(dpy, root, mw, mh, DefaultDepth(dpy, screen)); dc.gc = XCreateGC(dpy, root, 0, 0);