diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2019-12-10 16:15:26 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2019-12-10 16:15:26 +1300 |
commit | 61674507111c4b73224f19730c06cc02dd3ff21f (patch) | |
tree | ab5abcd79754ec22f68620e69c5bcf5f5efd7372 /funcptrptr.c | |
parent | Adjust implementation (diff) | |
download | funcptr-master.tar.gz funcptr-master.zip |
Diffstat (limited to 'funcptrptr.c')
-rw-r--r-- | funcptrptr.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/funcptrptr.c b/funcptrptr.c index 3d2fe69..b860628 100644 --- a/funcptrptr.c +++ b/funcptrptr.c @@ -45,14 +45,16 @@ int main(int argc, char **argv) { int i, j, im, jm; im = jm = 2; - fpvvv = calloc(im, sizeof *fpvvv); + fpvvv = calloc(im + 1, sizeof *fpvvv); for (i = 0; i < im; i++) { - fpvvv[i] = calloc(jm, sizeof **fpvvv); + fpvvv[i] = calloc(jm + 1, sizeof **fpvvv); for (j = 0; j < jm; j++) { fpvvv[i][j] = malloc(sizeof fpv); memcpy(fpvvv[i][j], fpv, sizeof fpv); } + fpvvv[i][jm + 1] = NULL; } + fpvvv[im + 1] = NULL; for (argv++, argc--; argc; argv++, argc--) fpvvv_exec(fpvvv, atoi(*argv)); |