Commit e3fd8feae6179d975239702a3da3b143bd27a248

Sam Lantinga 2022-05-16T06:16:32

Fixed getting the controller index when specifying --virtual (thanks @zturtleman)

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/test/testgamecontroller.c b/test/testgamecontroller.c
index ef0838c..086a340 100644
--- a/test/testgamecontroller.c
+++ b/test/testgamecontroller.c
@@ -820,7 +820,7 @@ main(int argc, char *argv[])
             }
         }
         if (argv[i] && *argv[i] != '-') {
-            controller_index = SDL_atoi(argv[1]);
+            controller_index = SDL_atoi(argv[i]);
             break;
         }
     }