[Libguestfs] [PATCH 1/3] daemon: parted: refactor sgdisk info parsing code

Richard W.M. Jones rjones at redhat.com
Tue Feb 4 15:56:54 UTC 2014


On Tue, Feb 04, 2014 at 04:01:31PM +0100, Pino Toscano wrote:
> @@ -832,28 +835,22 @@ do_part_get_gpt_type(const char *device, int partnum)
>      /* Split the line in 2 at the colon */
>      char *colon = strchr (line, ':');
>      if (colon) {
> -#define SEARCH "Partition GUID code"
> -      if (colon - line == strlen(SEARCH) &&
> -          memcmp (line, SEARCH, strlen(SEARCH)) == 0)
> +      if (colon - line == fieldlen &&
> +          memcmp (line, field, fieldlen) == 0)

Maybe use STRPREFIX macro here?

Looks fine, ACK.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.
http://people.redhat.com/~rjones/virt-df/




More information about the Libguestfs mailing list