summaryrefslogtreecommitdiff
path: root/src/scanopt.c
diff options
context:
space:
mode:
authorrlar <rlar>2016-02-29 20:15:29 +0100
committerWill Estes <westes575@gmail.com>2016-03-01 06:05:21 -0500
commit22d123c1fe6f6298616ae80b7be7f3a52cedf068 (patch)
tree5236fed497524cb0df1ab05f5a18a5a5864df8fa /src/scanopt.c
parentd2c0374297b7dd687a89227f3e77ff3f244da94b (diff)
add (size_t) casts to malloc invocations to prevent warnings
Diffstat (limited to 'src/scanopt.c')
-rw-r--r--src/scanopt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/scanopt.c b/src/scanopt.c
index d829d0f..a118541 100644
--- a/src/scanopt.c
+++ b/src/scanopt.c
@@ -157,7 +157,7 @@ scanopt_t *scanopt_init (const optspec_t *options, int argc, char **argv, int fl
s->optc++;
/* Build auxiliary data */
- s->aux = malloc(s->optc * sizeof (struct _aux));
+ s->aux = malloc((size_t) s->optc * sizeof (struct _aux));
for (i = 0; i < s->optc; i++) {
const unsigned char *p, *pname;
@@ -261,7 +261,7 @@ int scanopt_usage (scanopt_t *scanner, FILE *fp, const char *usage)
fprintf (fp, "\n");
/* Sort by r_val and string. Yes, this is O(n*n), but n is small. */
- store = malloc(s->optc * sizeof (usg_elem));
+ store = malloc((size_t) s->optc * sizeof (usg_elem));
for (i = 0; i < s->optc; i++) {
/* grab the next preallocate node. */