Skip to content

Doesn't handle -display option #1

@morgant

Description

@morgant

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions