fix argv handling

This commit is contained in:
nora 2023-10-01 11:35:53 +02:00
parent 21d3f12572
commit 613482b8c4
7 changed files with 28 additions and 5 deletions

9
tests/c/argv.c Normal file
View file

@ -0,0 +1,9 @@
#include<stdio.h>
int main(int argc, char* argv[]) {
char *self = argv[0];
char first = self[0];
if (first != '/') {
return 1;
}
}

8
tests/c/malloc.c Normal file
View file

@ -0,0 +1,8 @@
#include<stdlib.h>
int main(void) {
char *alloc = (char*) malloc(10);
*alloc = 1;
*(alloc + 9) = 2;
free(alloc);
}