summaryrefslogtreecommitdiff
path: root/src/sum.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1998-04-12 09:27:45 +0000
committerJim Meyering <jim@meyering.net>1998-04-12 09:27:45 +0000
commitd4257e63c7956d7a77349f0e3b693afa5e1ab9df (patch)
tree37c7c7ae817f492796a4b084772a4e2c39acedb9 /src/sum.c
parent7154d646cb343aa28459ffbfb5a1ca7057f3c8d7 (diff)
downloadcoreutils-d4257e63c7956d7a77349f0e3b693afa5e1ab9df.tar.xz
Use STREQ rather than strcmp
Diffstat (limited to 'src/sum.c')
-rw-r--r--src/sum.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/sum.c b/src/sum.c
index 0e0fdebcd..de3dfe15a 100644
--- a/src/sum.c
+++ b/src/sum.c
@@ -92,7 +92,7 @@ bsd_sum_file (const char *file, int print_name)
register long total_bytes = 0; /* The number of bytes. */
register int ch; /* Each character read. */
- if (!strcmp (file, "-"))
+ if (STREQ (file, "-"))
{
fp = stdin;
have_read_stdin = 1;
@@ -118,12 +118,12 @@ bsd_sum_file (const char *file, int print_name)
if (ferror (fp))
{
error (0, errno, "%s", file);
- if (strcmp (file, "-"))
+ if (!STREQ (file, "-"))
fclose (fp);
return -1;
}
- if (strcmp (file, "-") && fclose (fp) == EOF)
+ if (!STREQ (file, "-") && fclose (fp) == EOF)
{
error (0, errno, "%s", file);
return -1;
@@ -151,7 +151,7 @@ sysv_sum_file (const char *file, int print_name)
register unsigned long checksum = 0;
long total_bytes = 0;
- if (!strcmp (file, "-"))
+ if (STREQ (file, "-"))
{
fd = 0;
have_read_stdin = 1;
@@ -178,12 +178,12 @@ sysv_sum_file (const char *file, int print_name)
if (bytes_read < 0)
{
error (0, errno, "%s", file);
- if (strcmp (file, "-"))
+ if (!STREQ (file, "-"))
close (fd);
return -1;
}
- if (strcmp (file, "-") && close (fd) == -1)
+ if (!STREQ (file, "-") && close (fd) == -1)
{
error (0, errno, "%s", file);
return -1;