From: Matthew Booth Date: Mon, 17 Oct 2011 15:07:31 +0000 (+0100) Subject: NFC: Remove unnecessary goto X-Git-Tag: 1.13.22~6 X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=commitdiff_plain;h=1f615fddaffd33afc75a582021769583c8f4db4e NFC: Remove unnecessary goto --- diff --git a/src/inspect_fs_unix.c b/src/inspect_fs_unix.c index 04430e4..34e65bf 100644 --- a/src/inspect_fs_unix.c +++ b/src/inspect_fs_unix.c @@ -877,15 +877,13 @@ resolve_fstab_device (guestfs_h *g, const char *spec) free (slice); free (part); - if (disk_i == -1 || disk_i > 26 || - slice_i <= 0 || slice_i > 1 /* > 4 .. see comment above */ || - part_i < 0 || part_i >= 26) - goto out; - - device = safe_asprintf (g, "/dev/sd%c%d", disk_i + 'a', part_i + 5); + if (disk_i != -1 && disk_i <= 26 && + slice_i > 0 && slice_i <= 1 /* > 4 .. see comment above */ && + part_i >= 0 && part_i < 26) { + device = safe_asprintf (g, "/dev/sd%c%d", disk_i + 'a', part_i + 5); + } } - out: /* Didn't match device pattern, return original spec unchanged. */ if (device == NULL) device = safe_strdup (g, spec);