summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthew Booth <mbooth@redhat.com>2011-10-17 16:07:31 +0100
committerRichard W.M. Jones <rjones@redhat.com>2011-10-19 16:27:38 +0100
commit1f615fddaffd33afc75a582021769583c8f4db4e (patch)
treef249c0435cd00e528472b357838bd6494bfbb68c /src
parentf1041e912b72116d66274d2f15e50ce34a9531fd (diff)
downloadlibguestfs-1f615fddaffd33afc75a582021769583c8f4db4e.tar.gz
libguestfs-1f615fddaffd33afc75a582021769583c8f4db4e.tar.xz
libguestfs-1f615fddaffd33afc75a582021769583c8f4db4e.zip
NFC: Remove unnecessary goto
Diffstat (limited to 'src')
-rw-r--r--src/inspect_fs_unix.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/inspect_fs_unix.c b/src/inspect_fs_unix.c
index 04430e40..34e65bf6 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);