From a261442279b51a916806dd1bf4c6bd4ba6431074 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 5 Mar 2015 09:04:02 +0100 Subject: output/winmm: eliminate "goto" --- src/output/plugins/WinmmOutputPlugin.cxx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/output') 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; -- cgit v1.2.3