Remove an unneeded variable and fix a little whitespace.

Found using Clang's static analyzer.
This commit is contained in:
Brett Cannon 2010-05-05 20:26:58 +00:00
parent b166afc17c
commit 8b9c04941b
1 changed files with 2 additions and 3 deletions

View File

@ -59,14 +59,13 @@ getcwd(char *buf, int size)
{
FILE *fp;
char *p;
int sts;
if (size <= 0) {
errno = EINVAL;
return NULL;
}
if ((fp = popen(PWD_CMD, "r")) == NULL)
return NULL;
if (fgets(buf, size, fp) == NULL || (sts = pclose(fp)) != 0) {
if (fgets(buf, size, fp) == NULL || pclose(fp) != 0) {
errno = EACCES; /* Most likely error */
return NULL;
}