/* allocate argv, and populate it with the argument list. */
max_args = 8;
- f->argv = malloc(sizeof(char *) * (max_args + 1));
+ f->argv = malloc(sizeof(char *) * (size_t) (max_args + 1));
if (!f->argv)
flexerror(_("malloc failed (f->argv) in filter_create_ext"));
f->argv[f->argc++] = cmd;
while ((s = va_arg (ap, const char *)) != NULL) {
if (f->argc >= max_args) {
max_args += 8;
- f->argv = realloc(f->argv, sizeof(char*) * (max_args + 1));
+ f->argv = realloc(f->argv, sizeof(char*) * (size_t) (max_args + 1));
}
f->argv[f->argc++] = s;
}
fprintf (to_c, "m4_define( [[M4_YY_OUTFILE_NAME]],[[%s]])m4_dnl\n",
outfilename ? outfilename : "<stdout>");
- buf = malloc(readsz);
+ buf = malloc((size_t) readsz);
if (!buf)
flexerror(_("malloc failed in filter_tee_header"));
while (fgets (buf, readsz, stdin)) {
{
if(!sko_stack){
sko_sz = 1;
- sko_stack = malloc(sizeof(struct sko_state) * sko_sz);
+ sko_stack = malloc(sizeof(struct sko_state) * (size_t) sko_sz);
if (!sko_stack)
flexfatal(_("allocation of sko_stack failed"));
sko_len = 0;
if(sko_len >= sko_sz){
sko_sz *= 2;
sko_stack = realloc(sko_stack,
- sizeof(struct sko_state) * sko_sz);
+ sizeof(struct sko_state) * (size_t) sko_sz);
}
/* initialize to zero and push */
{
void *result;
- result = malloc(size);
+ result = malloc((size_t) size);
if (!result)
flexfatal (_
("memory allocation failed in yy_flex_xmalloc()"));
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;
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. */
}
total_len = yytbl_calc_total_len (tbl);
- newtbl.td_data = calloc (total_len, newsz);
+ newtbl.td_data = calloc ((size_t) total_len, newsz);
newtbl.td_flags =
TFLAGS_CLRDATA (newtbl.td_flags) | BYTES2TFLAG (newsz);