diff --git a/src/conky.c b/src/conky.c index 0b8d6441..8b0763dc 100644 --- a/src/conky.c +++ b/src/conky.c @@ -9257,11 +9257,6 @@ void initialisation(int argc, char **argv) { case 'a': text_alignment = string_to_alignment(optarg); break; - case 'X': - if (disp) - free(disp); - disp = strdup(optarg); - break; #ifdef OWN_WINDOW case 'o': @@ -9459,6 +9454,11 @@ int main(int argc, char **argv) case 'w': window.window = strtol(optarg, 0, 0); break; + case 'X': + if (disp) + free(disp); + disp = strdup(optarg); + break; #endif /* X11 */ case '?': diff --git a/src/x11.c b/src/x11.c index 286e0707..5d325cd4 100644 --- a/src/x11.c +++ b/src/x11.c @@ -76,7 +76,7 @@ void init_X11(const char *disp) { if (!display) { if ((display = XOpenDisplay(disp)) == NULL) { - CRIT_ERR(NULL, NULL, "can't open display: %s", XDisplayName(0)); + CRIT_ERR(NULL, NULL, "can't open display: %s", XDisplayName(disp)); } }