Skip to content

Commit a6f4f74

Browse files
authored
Merge pull request #69 from gtker/main
Remove incorrect pointer arithmetic from setenv/getenv
2 parents 8ebbe0a + fd3e240 commit a6f4f74

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

stdlib.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ char* getenv (char const* name)
438438
if(q[0] == '=')
439439
return q + 1;
440440
}
441-
p += sizeof(char**); /* M2 pointer arithemtic */
441+
p += 1;
442442
}
443443

444444
return 0;
@@ -475,7 +475,7 @@ int setenv(char const *s, char const *v, int overwrite_p)
475475
if (q[0] == '=')
476476
break;
477477
}
478-
p += sizeof(char**); /* M2 pointer arithemtic */
478+
p += 1;
479479
}
480480
char *entry = malloc (length + _strlen(v) + 2);
481481
int end_p = p[0] == 0;

0 commit comments

Comments
 (0)