diff options
author | midipix <writeonce@midipix.org> | 2015-12-31 09:35:11 -0500 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2016-11-11 00:22:32 -0500 |
commit | bea9e7fac004d8631d521a2087dff59ee2fbcb72 (patch) | |
tree | 314a5b14045c79a1c64487ecc3e4b223ad5675df /src | |
parent | c71aad39229fe643928813d15f710baeca8a760c (diff) | |
download | mdso-bea9e7fac004d8631d521a2087dff59ee2fbcb72.tar.bz2 mdso-bea9e7fac004d8631d521a2087dff59ee2fbcb72.tar.xz |
driver: fix semantics of calloc() calls.
Diffstat (limited to 'src')
-rw-r--r-- | src/driver/mdso_driver_ctx.c | 2 | ||||
-rw-r--r-- | src/driver/mdso_unit_ctx.c | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/driver/mdso_driver_ctx.c b/src/driver/mdso_driver_ctx.c index 14f1e75..aec63a6 100644 --- a/src/driver/mdso_driver_ctx.c +++ b/src/driver/mdso_driver_ctx.c @@ -75,7 +75,7 @@ static struct mdso_driver_ctx_impl * mdso_driver_ctx_alloc( size = sizeof(struct mdso_driver_ctx_alloc); size += (nunits+1)*sizeof(const char *); - if (!(ictx = calloc(size,1))) + if (!(ictx = calloc(1,size))) return 0; if (cctx) diff --git a/src/driver/mdso_unit_ctx.c b/src/driver/mdso_unit_ctx.c index ae90394..807e80e 100644 --- a/src/driver/mdso_unit_ctx.c +++ b/src/driver/mdso_unit_ctx.c @@ -104,10 +104,10 @@ static int mdso_create_symbol_vector(struct mdso_unit_ctx_impl * ctx) size = offsetof(struct mdso_unit_ctx_impl,expsyms); size += (nsyms+1)*sizeof(const char *); - if (!(ctx->expsyms = calloc(size,1))) + if (!(ctx->expsyms = calloc(1,size))) return -1; - if (!(ctx->expsyms->buffer = calloc(ctx->map.size,1))) + if (!(ctx->expsyms->buffer = calloc(1,ctx->map.size))) return -1; ch = ctx->map.addr; @@ -169,7 +169,7 @@ int mdso_get_unit_ctx( FILE * ftmp; int fd; - if (!dctx || !(ctx = calloc(sizeof(*ctx),1))) + if (!dctx || !(ctx = calloc(1,sizeof(*ctx)))) return -1; if (strcmp(path,"-")) |