diff options
author | Jim Meyering <meyering@redhat.com> | 2009-11-09 14:26:21 +0100 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2009-11-09 22:34:16 +0100 |
commit | 3e70b34eed5a48640e20fbf6dcba774aaace1f3c (patch) | |
tree | 5bb681d85d8ff394f562b095e70c36d4ac5f7b5d /fish | |
parent | 627f89351d06e43564b47ea42cabaa522284c2a1 (diff) | |
download | libguestfs-3e70b34eed5a48640e20fbf6dcba774aaace1f3c.tar.gz libguestfs-3e70b34eed5a48640e20fbf6dcba774aaace1f3c.tar.xz libguestfs-3e70b34eed5a48640e20fbf6dcba774aaace1f3c.zip |
change strncmp() == 0 to STREQLEN()
git grep -l 'strncmp *([^=]*== *0'|xargs \
perl -pi -e 's/\bstrncmp( *\(.*?\)) *== *0\b/STREQLEN$1/g'
Diffstat (limited to 'fish')
-rw-r--r-- | fish/destpaths.c | 2 | ||||
-rw-r--r-- | fish/edit.c | 2 | ||||
-rw-r--r-- | fish/tilde.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/fish/destpaths.c b/fish/destpaths.c index 1e42ae80..9a3da82b 100644 --- a/fish/destpaths.c +++ b/fish/destpaths.c @@ -133,7 +133,7 @@ complete_dest_paths_generator (const char *text, int state) } while (0) /* Is it a device? */ - if (len < 5 || strncmp (text, "/dev/", 5) == 0) { + if (len < 5 || STREQLEN (text, "/dev/", 5)) { /* Get a list of everything that can possibly begin with /dev/ */ strs = guestfs_list_devices (g); APPEND_STRS_AND_FREE; diff --git a/fish/edit.c b/fish/edit.c index d30b3cad..3fc41fb1 100644 --- a/fish/edit.c +++ b/fish/edit.c @@ -149,7 +149,7 @@ do_edit (const char *cmd, int argc, char *argv[]) unlink (filename); /* Changed? */ - if (strlen (content) == size && strncmp (content, content_new, size) == 0) { + if (strlen (content) == size && STREQLEN (content, content_new, size)) { free (content); free (content_new); return 0; diff --git a/fish/tilde.c b/fish/tilde.c index 1c52d3ed..64b5b399 100644 --- a/fish/tilde.c +++ b/fish/tilde.c @@ -110,7 +110,7 @@ find_home_for_username (const char *username, size_t ulen) setpwent (); while ((pw = getpwent ()) != NULL) { if (strlen (pw->pw_name) == ulen && - strncmp (username, pw->pw_name, ulen) == 0) + STREQLEN (username, pw->pw_name, ulen)) return pw->pw_dir; } |