From 03899a62401e98a638c6b75d23229cd06291db66 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Wed, 3 May 2017 11:44:47 +0200 Subject: [PATCH] onepad: drop useless goto statement --- plugins/onepad/Linux/ini.cpp | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/plugins/onepad/Linux/ini.cpp b/plugins/onepad/Linux/ini.cpp index 085c7c26fb..77a867fa6a 100644 --- a/plugins/onepad/Linux/ini.cpp +++ b/plugins/onepad/Linux/ini.cpp @@ -122,18 +122,17 @@ void LoadConfig() } u32 value; - if (fscanf(f, "log = %u\n", &value) == 0) - goto error; - conf->log = value; - if (fscanf(f, "options = %u\n", &value) == 0) - goto error; - conf->packed_options = value; - if (fscanf(f, "mouse_sensibility = %u\n", &value) == 0) - goto error; - conf->set_sensibility(value); - if (fscanf(f, "ff_intensity = %u\n", &value) == 0) - goto error; - conf->set_ff_intensity(value); + if (fscanf(f, "log = %u\n", &value) == 1) + conf->log = value; + + if (fscanf(f, "options = %u\n", &value) == 1) + conf->packed_options = value; + + if (fscanf(f, "mouse_sensibility = %u\n", &value) == 1) + conf->set_sensibility(value); + + if (fscanf(f, "ff_intensity = %u\n", &value) == 1) + conf->set_ff_intensity(value); size_t uid; if (fscanf(f, "uid[0] = %zu\n", &uid) == 1) @@ -153,6 +152,5 @@ void LoadConfig() if (!have_user_setting) DefaultKeyboardValues(); -error: fclose(f); }