summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2009-01-15 17:26:59 +0000
committerPádraig Brady <P@draigBrady.com>2009-01-16 11:06:09 +0000
commit9934f5028228ac761e545ed46992cfed633f46af (patch)
treec4a488748ba528d740a2ce4d515c12f86e743b94 /src
parent46d6df933ec6171fcfa0220dfb8f18f68293797b (diff)
downloadcoreutils-9934f5028228ac761e545ed46992cfed633f46af.tar.xz
shred: avoid -Wsign-compare warnings
* src/shred.c: Use already assigned signed variable sizeof_r, rather than the unsigned sizeof(r). Don't use signed integer overflow check that contemporary compilers may remove anyway.
Diffstat (limited to 'src')
-rw-r--r--src/shred.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/shred.c b/src/shred.c
index 1e7bffb90..224f671cc 100644
--- a/src/shred.c
+++ b/src/shred.c
@@ -1,6 +1,6 @@
/* shred.c - overwrite files and devices to make it harder to recover data
- Copyright (C) 1999-2008 Free Software Foundation, Inc.
+ Copyright (C) 1999-2009 Free Software Foundation, Inc.
Copyright (C) 1997, 1998, 1999 Colin Plumb.
This program is free software: you can redistribute it and/or modify
@@ -399,7 +399,7 @@ dopass (int fd, char const *qname, off_t *sizep, int type,
/* Constant fill patterns need only be set up once. */
if (type >= 0)
{
- lim = (0 <= size && size < sizeof_r ? size : sizeof r);
+ lim = (0 <= size && size < sizeof_r ? size : sizeof_r);
fillpattern (type, r.u, lim);
passname (r.u, pass_string);
}
@@ -488,7 +488,7 @@ dopass (int fd, char const *qname, off_t *sizep, int type,
/* Okay, we have written "soff" bytes. */
- if (offset + soff < offset)
+ if (offset > OFF_T_MAX - (off_t) soff)
{
error (0, 0, _("%s: file too large"), qname);
return -1;