Commit 8b9c0494 authored by Brett Cannon's avatar Brett Cannon

Remove an unneeded variable and fix a little whitespace.

Found using Clang's static analyzer.
parent b166afc1
...@@ -59,14 +59,13 @@ getcwd(char *buf, int size) ...@@ -59,14 +59,13 @@ getcwd(char *buf, int size)
{ {
FILE *fp; FILE *fp;
char *p; char *p;
int sts;
if (size <= 0) { if (size <= 0) {
errno = EINVAL; errno = EINVAL;
return NULL; return NULL;
} }
if ((fp = popen(PWD_CMD, "r")) == NULL) if ((fp = popen(PWD_CMD, "r")) == NULL)
return 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 */ errno = EACCES; /* Most likely error */
return NULL; return NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment