]> granicus.if.org Git - flex/commitdiff
Modified to use yy_flex_alloc() and friends
authorVern Paxson <vern@ee.lbl.gov>
Sat, 12 Jun 1993 13:42:32 +0000 (13:42 +0000)
committerVern Paxson <vern@ee.lbl.gov>
Sat, 12 Jun 1993 13:42:32 +0000 (13:42 +0000)
misc.c

diff --git a/misc.c b/misc.c
index b66b0ec148cc17f2f13399ded0de190498e307a3..bb77474ea1e8fecfc50fa91f12b61a44db7131f0 100644 (file)
--- 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" );