Skip to content

Commit 7071816

Browse files
committed
Merge branch 'master' into 'master'
Fixed segfault with arguments Fixes #3 See merge request !1
2 parents 47d0946 + 7e3070e commit 7071816

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

main.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,14 +268,16 @@ void playSong(SteamControllerInfos* controller,const ParamsStruct params){
268268
bool parseArguments(int argc, char** argv, ParamsStruct* params){
269269
int c;
270270
while ( (c = getopt(argc, argv, "l:i:r")) != -1) {
271-
unsigned long int value = strtoul(optarg,NULL,10);
272-
switch(c){
271+
unsigned long int value;
272+
switch(c){
273273
case 'l':
274+
value = strtoul(optarg,NULL,10);
274275
if(value <= LIBUSB_LOG_LEVEL_DEBUG){
275276
params->libusbDebugLevel = value;
276277
}
277278
break;
278279
case 'i':
280+
value = strtoul(optarg,NULL,10);
279281
if(value <= 1000000){
280282
params->intervalUSec = value;
281283
}

0 commit comments

Comments
 (0)