diff --git a/src/cursor_xcursor.c b/src/cursor_xcursor.c index f202b5b..4f41138 100644 --- a/src/cursor_xcursor.c +++ b/src/cursor_xcursor.c @@ -35,13 +35,18 @@ static int alock_cursor_xcursor_init(const char* args, struct aXInfo* xinfo) { if (!xinfo) return 0; - if (!args || strlen(args) < 8) { - printf("alock: error, missing arguments for [xcursor]\n"); + if (!args || strlen(args) < 13) { + printf("alock: error, missing arguments for [xcursor].\n"); return 0; } - if (!(cursor = XcursorFilenameLoadCursor(xinfo->display, &args[8]))) { - printf("alock: error, couldnt load [%s]\n", &args[8]); + if (strstr(args, "xcursor:") != args || strstr(&args[8], "file=") != &args[8]) { + printf("alock: error, wrong arguments for [xcursor].\n"); + return 0; + } + + if (!(cursor = XcursorFilenameLoadCursor(xinfo->display, &args[13]))) { + printf("alock: error, couldnt load [%s]\n", &args[13]); return 0; }