-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers
Description
Currently, mlclock doesn't actually handle any command line options, including. the documented -display option. The offending code is the following in main():
str[0] = '\0';
i = 1;
while ( i < argc ) {
if ( !strcmp("-display", argv[i]) ) {
i++;
if ( argc >= argc )
usage(argv[0]);
strcpy(str, argv[i]);
break;
}
usage(argv[0]);
}
dpy = XOpenDisplay(NULL);
I believe the if ( argc >= argc ) should be if ( i >= argc ). Of course, str is not passed into XOpenDisplay() either (though it's reused later down in main()), despite potentially containing the display name. And the usage will always be displayed, so should probably be behind another conditional.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers