Files
RedBear-OS/tests/unistd/chdir.c
T
Tibor Nagy 4381bb2a22 tests: Remove redundant return statements
When the execution reaches the end of the main functions, they implicitly return a successful status.
2019-02-20 21:09:03 +01:00

16 lines
422 B
C

#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
int main(void) {
char* cwd1 = malloc(4096*sizeof(char));//(char*) calloc(4096 + 1, sizeof(char));
getcwd(cwd1, 4096);
printf("initial cwd: %s\n", cwd1);
free(cwd1);
chdir("..");
char* cwd2 = malloc(4096*sizeof(char));//(char*) calloc(4096 + 1, sizeof(char));
getcwd(cwd2, 4096);
printf("final cwd: %s\n", cwd2);
free(cwd2);
}