]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Add parentheses to expressions like (c = *p++) as per suggestion
authorJim Meyering <jim@meyering.net>
Sat, 31 Oct 1992 23:00:13 +0000 (23:00 +0000)
committerJim Meyering <jim@meyering.net>
Sat, 31 Oct 1992 23:00:13 +0000 (23:00 +0000)
from gcc -Wall.

src/cp.c
src/ls.c

index d71734454697f0e39a37950a573582f33cf05b11..e84fd158b23266ec69dda31d4fcbe377ed6da58a 100644 (file)
--- a/src/cp.c
+++ b/src/cp.c
@@ -834,7 +834,7 @@ make_path (const_dirpath, src_offset, mode, verbose_fmt_string,
       slash = src;
       while (*slash == '/')
        slash++;
-      while (slash = index (slash, '/'))
+      while ((slash = index (slash, '/')))
        {
          /* Add this directory to the list of directories whose modes need
             fixing later. */
index 3f207274d73f88ce931950eb8b03e8849210637c..24343a695acd9467f6144884728e0788d75c161f 100644 (file)
--- a/src/ls.c
+++ b/src/ls.c
@@ -783,7 +783,7 @@ print_dir (name, realname)
 
   clear_files ();
 
-  while (next = readdir (reading))
+  while ((next = readdir (reading)) != NULL)
     if (file_interesting (next))
       total_blocks += gobble_file (next->d_name, 0, name);
 
@@ -1429,7 +1429,7 @@ print_name_with_quoting (p)
   if (quote_as_string)
     putchar ('"');
 
-  while (c = *p++)
+  while ((c = *p++))
     {
       if (quote_funny_chars)
        {
@@ -1554,7 +1554,7 @@ length_of_file_name_and_frills (f)
   if (quote_as_string)
     len += 2;
 
-  while (c = *p++)
+  while ((c = *p++))
     {
       if (quote_funny_chars)
        {