From: Matthew Booth Date: Mon, 17 Oct 2011 15:07:31 +0000 (+0100) Subject: NFC: Remove unnecessary goto X-Git-Tag: 1.12.8~3 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=76d879e913003c4472a7237a6b2a86d31edafdb7;p=libguestfs.git NFC: Remove unnecessary goto Cherry picked from commit 1f615fddaffd33afc75a582021769583c8f4db4e and backported to libguestfs-1.12 branch. --- diff --git a/src/inspect_fs_unix.c b/src/inspect_fs_unix.c index e2fad51..72b5666 100644 --- a/src/inspect_fs_unix.c +++ b/src/inspect_fs_unix.c @@ -795,15 +795,13 @@ resolve_fstab_device (guestfs_h *g, const char *spec) free (bsdslice); free (bsdpart); - if (disk == -1 || disk > 26 || - slice <= 0 || slice > 1 /* > 4 .. see comment above */ || - part < 0 || part >= 26) - goto out; - - device = safe_asprintf (g, "/dev/sd%c%d", disk + 'a', part + 5); + if (disk != -1 && disk <= 26 && + slice > 0 && slice <= 1 /* > 4 .. see comment above */ && + part >= 0 && part < 26) { + device = safe_asprintf (g, "/dev/sd%c%d", disk + 'a', part + 5); + } } - out: /* Didn't match device pattern, return original spec unchanged. */ if (device == NULL) device = safe_strdup (g, spec);