Simplify parsing of --size.
This commit is contained in:
parent
c9854deeec
commit
c9b8bfdbbc
14
retroarch.c
14
retroarch.c
|
@ -1196,19 +1196,7 @@ static void parse_input(int argc, char *argv[])
|
||||||
#ifdef HAVE_FFMPEG
|
#ifdef HAVE_FFMPEG
|
||||||
case 's':
|
case 's':
|
||||||
{
|
{
|
||||||
errno = 0;
|
if (sscanf(optarg, "%ux%u", &g_extern.record_width, &g_extern.record_height) != 2)
|
||||||
char *ptr;
|
|
||||||
g_extern.record_width = strtoul(optarg, &ptr, 0);
|
|
||||||
if ((*ptr != 'x') || errno)
|
|
||||||
{
|
|
||||||
RARCH_ERR("Wrong format for --size.\n");
|
|
||||||
print_help();
|
|
||||||
rarch_fail(1, "parse_input()");
|
|
||||||
}
|
|
||||||
|
|
||||||
ptr++;
|
|
||||||
g_extern.record_height = strtoul(ptr, &ptr, 0);
|
|
||||||
if ((*ptr != '\0') || errno)
|
|
||||||
{
|
{
|
||||||
RARCH_ERR("Wrong format for --size.\n");
|
RARCH_ERR("Wrong format for --size.\n");
|
||||||
print_help();
|
print_help();
|
||||||
|
|
Loading…
Reference in New Issue