File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7725,12 +7725,27 @@ static bool retroarch_parse_input_and_config(
77257725 break ;
77267726
77277727 case RA_OPT_SIZE :
7728- if (sscanf (optarg , "%ux%u" ,
7729- & rec_st -> width , & rec_st -> height ) != 2 )
77307728 {
7731- RARCH_ERR ("Wrong format for --size.\n" );
7732- retroarch_print_help (argv [0 ]);
7733- retroarch_fail (1 , "retroarch_parse_input()" );
7729+ char * sep ;
7730+ unsigned long w = (unsigned long )strtoul (optarg , & sep , 0 );
7731+ if (sep == optarg || * sep != 'x' )
7732+ {
7733+ RARCH_ERR ("Wrong format for --size.\n" );
7734+ retroarch_print_help (argv [0 ]);
7735+ retroarch_fail (1 , "retroarch_parse_input()" );
7736+ }
7737+ {
7738+ char * end ;
7739+ unsigned long h = (unsigned long )strtoul (sep + 1 , & end , 0 );
7740+ if (end == sep + 1 || * end != '\0' )
7741+ {
7742+ RARCH_ERR ("Wrong format for --size.\n" );
7743+ retroarch_print_help (argv [0 ]);
7744+ retroarch_fail (1 , "retroarch_parse_input()" );
7745+ }
7746+ rec_st -> width = (unsigned )w ;
7747+ rec_st -> height = (unsigned )h ;
7748+ }
77347749 }
77357750 break ;
77367751
You can’t perform that action at this time.
0 commit comments