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.
Currently,
mlclockdoesn't actually handle any command line options, including. the documented-displayoption. The offending code is the following inmain():I believe the
if ( argc >= argc )should beif ( i >= argc ). Of course,stris not passed intoXOpenDisplay()either (though it's reused later down inmain()), despite potentially containing the display name. And theusagewill always be displayed, so should probably be behind another conditional.