summaryrefslogtreecommitdiffstats
path: root/examples/to-xml.c
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2009-11-09 14:30:11 +0100
committerJim Meyering <meyering@redhat.com>2009-11-09 22:34:16 +0100
commit9a8889e4d0c532b9f77af3a9cc7aae06adebfb83 (patch)
treee2d7910ea5b028ed2628b8006f209eea843458e5 /examples/to-xml.c
parent3e70b34eed5a48640e20fbf6dcba774aaace1f3c (diff)
downloadlibguestfs-9a8889e4d0c532b9f77af3a9cc7aae06adebfb83.tar.gz
libguestfs-9a8889e4d0c532b9f77af3a9cc7aae06adebfb83.tar.xz
libguestfs-9a8889e4d0c532b9f77af3a9cc7aae06adebfb83.zip
use STREQ, not strcmp: part 1
git grep -l 'strcmp *([^=]*== *0'|xargs \ perl -pi -e 's/\bstrcmp( *\(.*?\)) *== *0/STREQ$1/g'
Diffstat (limited to 'examples/to-xml.c')
-rw-r--r--examples/to-xml.c6
1 files changed, 3 insertions, 3 deletions
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 ("<windows/>\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 ("<uuid>%s</uuid>\n", sbfields[i+1]);
- else if (strcmp (sbfields[i], "Block size") == 0)
+ else if (STREQ (sbfields[i], "Block size"))
printf ("<blocksize>%s</blocksize>\n", sbfields[i+1]);
free (sbfields[i]);