This commit is contained in:
Yorick Barbanneau 2023-04-17 18:00:20 +02:00
parent 7c934bcefb
commit 453d88282f
8 changed files with 588 additions and 0 deletions

View file

@ -0,0 +1,19 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
void f(char *x, int n) {
memset(x, '\0', n);
}
void g(char *y, int n) {
return f(y, n);
}
int main(void) {
char *a = strdup("aaa");
g(a, sizeof(a)+1);
printf("%p\n", &a);
free(a);
return 0;
}