From 2d95f93b3da682c8c000383ea7e76eeb8f5990c0 Mon Sep 17 00:00:00 2001 From: Vern Paxson Date: Sat, 12 Jun 1993 13:42:32 +0000 Subject: [PATCH] Modified to use yy_flex_alloc() and friends --- misc.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/misc.c b/misc.c index b66b0ec..bb77474 100644 --- a/misc.c +++ b/misc.c @@ -82,7 +82,7 @@ int size, element_size; if ( element_size * size <= 0 ) flexfatal( "request for < 1 byte in allocate_array()" ); - mem = (void *) malloc( (unsigned) (element_size * size) ); + mem = yy_flex_alloc( element_size * size ); if ( mem == NULL ) flexfatal( "memory allocation failed in allocate_array()" ); @@ -175,7 +175,7 @@ register char *str; for ( c = str; *c; ++c ) ; - copy = malloc( (unsigned) ((c - str + 1) * sizeof( char )) ); + copy = yy_flex_alloc( (c - str + 1) * sizeof( char ) ); if ( copy == NULL ) flexfatal( "dynamic memory failure in copy_string()" ); @@ -666,8 +666,7 @@ int size, element_size; flexfatal( "attempt to increase array size by less than 1 byte" ); - new_array = - (void *) realloc( (char *)array, (unsigned) (size * element_size )); + new_array = yy_flex_realloc( array, size * element_size ); if ( new_array == NULL ) flexfatal( "attempt to increase array size failed" ); -- 2.50.0