sbase

suckless unix tools
git clone git://git.2f30.org/sbase.git
Log | Files | Refs | README | LICENSE

commit cc27d5deb7dd135783f81dc6e945d69cd1c1ff7c
parent a6c194fc749699155abc7d44cba2add1da3360b3
Author: Michael Forney <mforney@mforney.org>
Date:   Fri Jul  8 10:24:12 -0700

touch: Remove useless variable

The only possible return values of stat are 0 or -1, so it doesn't make sense to
store the return value in a variable to make sure it is not positive.

Diffstat:
touch.c | 5++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/touch.c b/touch.c @@ -21,14 +21,13 @@ touch(const char *file) { int fd; struct stat st; - int r; - if ((r = stat(file, &st)) < 0) { + if (stat(file, &st) < 0) { if (errno != ENOENT) eprintf("stat %s:", file); if (cflag) return; - } else if (!r) { + } else { if (!aflag) times[0] = st.st_atim; if (!mflag)