summaryrefslogtreecommitdiff
path: root/xdriinfo.c
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@herrb.eu>2023-06-15 18:00:17 +0200
committerMatthieu Herrb <matthieu@herrb.eu>2023-06-15 18:00:17 +0200
commit3c4706d95150d10d05c55af58129d4294d14eb93 (patch)
treea4a4013fd59ab62c659f3ad0cea7d1ef567d71ab /xdriinfo.c
parent7c0fdf2628d0047bef57143aa3d672a3648940f0 (diff)
parent149e46f06a661bd51f3a247dd41a49b553fdca65 (diff)
Merge remote-tracking branch 'origin/master' into obsdobsd
Diffstat (limited to 'xdriinfo.c')
-rw-r--r--xdriinfo.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/xdriinfo.c b/xdriinfo.c
index c7e7482..35d7458 100644
--- a/xdriinfo.c
+++ b/xdriinfo.c
@@ -58,7 +58,7 @@ void printUsage (void) {
int main (int argc, char *argv[]) {
Display *dpy;
- int nScreens, screenNum, i;
+ int nScreens, screenNum;
enum INFO_FUNC func = LIST;
char *funcArg = NULL;
char *dpyName = NULL;
@@ -71,7 +71,7 @@ int main (int argc, char *argv[]) {
}
/* parse the command line */
- for (i = 1; i < argc; ++i) {
+ for (int i = 1; i < argc; ++i) {
char **argPtr = NULL;
if (!strcmp (argv[i], "-display"))
argPtr = &dpyName;
@@ -112,6 +112,8 @@ int main (int argc, char *argv[]) {
return 1;
}
}
+ else
+ screenNum = -1;
/* driver command needs a valid screen number */
if (func == DRIVER && screenNum == -1) {
@@ -179,7 +181,7 @@ int main (int argc, char *argv[]) {
break;
}
case LIST:
- for (i = 0; i < nScreens; ++i) {
+ for (int i = 0; i < nScreens; ++i) {
const char *name = (*GetScreenDriver) (dpy, i);
if (name)
printf ("Screen %d: %s\n", i, name);