Use < 0 instead of == -1

This commit is contained in:
FRIGN
2014-11-19 20:59:37 +01:00
committed by sin
parent 9b38355ae8
commit 1436518f9d
21 changed files with 41 additions and 41 deletions

4
pwd.c
View File

@@ -41,9 +41,9 @@ getpwd(const char *cwd)
const char *pwd;
struct stat cst, pst;
if (!(pwd = getenv("PWD")) || pwd[0] != '/' || stat(pwd, &pst) == -1)
if (!(pwd = getenv("PWD")) || pwd[0] != '/' || stat(pwd, &pst) < 0)
return cwd;
if (stat(cwd, &cst) == -1)
if (stat(cwd, &cst) < 0)
eprintf("stat %s:", cwd);
if (pst.st_dev == cst.st_dev && pst.st_ino == cst.st_ino)
return pwd;