This commit is contained in:
cyjullien1
2024-12-12 12:10:47 +01:00
6 changed files with 22 additions and 8 deletions

View File

@@ -8,7 +8,7 @@
unsigned short int **creatArea2D(const unsigned int N)
{
unsigned short int **tab2d;
tab2d = malloc(sizeof(unsigned short int* ) * N);
tab2d = calloc(N, sizeof(unsigned short int* ));
if (tab2d == NULL)
{
return NULL;
@@ -18,7 +18,7 @@ unsigned short int **creatArea2D(const unsigned int N)
int i;
for (i = 0; i < N && !fail; ++i)
{
tab2d[i] = malloc(sizeof(unsigned short int) * N);
tab2d[i] = calloc(N, sizeof(unsigned short int));
if (tab2d[i] == NULL)
{
fail = true;