aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2015-03-05 09:04:02 +0100
committerMax Kellermann <max@duempel.org>2015-03-05 10:07:07 +0100
commita261442279b51a916806dd1bf4c6bd4ba6431074 (patch)
tree417ba457f0d79014e31f7cfeca504aefacffcd6a /src
parent2f41eba100f85f340ec9ca6b31f82dd3f22a01ff (diff)
downloadmpd-a261442279b51a916806dd1bf4c6bd4ba6431074.tar.gz
mpd-a261442279b51a916806dd1bf4c6bd4ba6431074.tar.xz
mpd-a261442279b51a916806dd1bf4c6bd4ba6431074.zip
output/winmm: eliminate "goto"
Diffstat (limited to 'src')
-rw-r--r--src/output/plugins/WinmmOutputPlugin.cxx10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/output/plugins/WinmmOutputPlugin.cxx b/src/output/plugins/WinmmOutputPlugin.cxx
index 4c7664c72..4a6cace29 100644
--- a/src/output/plugins/WinmmOutputPlugin.cxx
+++ b/src/output/plugins/WinmmOutputPlugin.cxx
@@ -96,8 +96,13 @@ get_device_id(const char *device_name, UINT *device_id, Error &error)
char *endptr;
UINT id = strtoul(device_name, &endptr, 0);
if (endptr > device_name && *endptr == 0) {
- if (id >= numdevs)
- goto fail;
+ if (id >= numdevs) {
+ error.Format(winmm_output_domain,
+ "device \"%s\" is not found",
+ device_name);
+ return false;
+ }
+
*device_id = id;
return true;
}
@@ -116,7 +121,6 @@ get_device_id(const char *device_name, UINT *device_id, Error &error)
}
}
-fail:
error.Format(winmm_output_domain,
"device \"%s\" is not found", device_name);
return false;