From 9a8889e4d0c532b9f77af3a9cc7aae06adebfb83 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Mon, 9 Nov 2009 14:30:11 +0100 Subject: use STREQ, not strcmp: part 1 git grep -l 'strcmp *([^=]*== *0'|xargs \ perl -pi -e 's/\bstrcmp( *\(.*?\)) *== *0/STREQ$1/g' --- examples/to-xml.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'examples/to-xml.c') diff --git a/examples/to-xml.c b/examples/to-xml.c index 43176195..ee1b3bff 100644 --- a/examples/to-xml.c +++ b/examples/to-xml.c @@ -120,7 +120,7 @@ display_partition (guestfs_h *g, const char *dev) CALL (what = guestfs_file (g, dev), NULL); - if (strcmp (what, "x86 boot sector") == 0) + if (STREQ (what, "x86 boot sector")) /* This is what 'file' program shows for Windows/NTFS partitions. */ printf ("\n"); else if (strstr (what, "boot sector") != NULL) @@ -190,9 +190,9 @@ display_ext234 (guestfs_h *g, const char *dev, const char *fstype) /* Just pick out a few important fields to display. There * is much more that could be displayed here. */ - if (strcmp (sbfields[i], "Filesystem UUID") == 0) + if (STREQ (sbfields[i], "Filesystem UUID")) printf ("%s\n", sbfields[i+1]); - else if (strcmp (sbfields[i], "Block size") == 0) + else if (STREQ (sbfields[i], "Block size")) printf ("%s\n", sbfields[i+1]); free (sbfields[i]); -- cgit