Skip to content

Commit ddb882a

Browse files
committed
Remove an unneeded variable and fix a little whitespace.
Found using Clang's static analyzer.
1 parent 91d2044 commit ddb882a

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

Python/getcwd.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ getcwd(char *buf, int size)
2828
{
2929
char localbuf[MAXPATHLEN+1];
3030
char *ret;
31-
31+
3232
if (size <= 0) {
3333
errno = EINVAL;
3434
return NULL;
@@ -59,14 +59,13 @@ getcwd(char *buf, int size)
5959
{
6060
FILE *fp;
6161
char *p;
62-
int sts;
6362
if (size <= 0) {
6463
errno = EINVAL;
6564
return NULL;
6665
}
6766
if ((fp = popen(PWD_CMD, "r")) == NULL)
6867
return NULL;
69-
if (fgets(buf, size, fp) == NULL || (sts = pclose(fp)) != 0) {
68+
if (fgets(buf, size, fp) == NULL || pclose(fp) != 0) {
7069
errno = EACCES; /* Most likely error */
7170
return NULL;
7271
}

0 commit comments

Comments
 (0)