GNU bug report logs -
#15356
[PATCH 00/19] Fedora parted patches
Previous Next
Reported by: "Brian C. Lane" <bcl <at> redhat.com>
Date: Wed, 11 Sep 2013 20:18:03 UTC
Severity: normal
Tags: patch
Done: Phillip Susi <psusi <at> ubuntu.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
On 11 September 2013 21:25, Brian C. Lane <bcl <at> redhat.com> wrote:
> From: "Brian C. Lane" <bcl <at> redhat.com>
> +static PedGeometry*
> +btrfs_probe (PedGeometry* geom)
> +{
...
> + if (geom->length < offset+1)
> + return 0;
> + if (!ped_geometry_read (geom, &buf, offset, 1))
> + return 0;
Should not these be NULL rather than 0?
> +
> + if (PED_LE64_TO_CPU(buf.sb.magic) == BTRFS_MAGIC) {
> + return ped_geometry_new (geom->dev, geom->start, geom->length);
> + }
> + return NULL;
> +}
When already providing feedback on this code, I will also ask if this
test can be reversed,
so that the conceptual flow is
if (some_error_condition) {
handle_error
}
normal_code
e.g. "test exceptions, not the normal case"
BR Håkon Løvdal
This bug report was last modified 11 years and 80 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.