Reimar Döffinger
2012-11-06 17:59:07 UTC
Hello,
this also fixes the fairly nonsense NULL checks that are done after we
would have crashed in memset...
Index: src/css.c
===================================================================
--- src/css.c (revision 255)
+++ src/css.c (working copy)
@@ -1163,8 +1163,7 @@
*/
/* initialize lookup tables for k[1] */
- K1table = malloc( 65536 * K1TABLEWIDTH );
- memset( K1table, 0 , 65536 * K1TABLEWIDTH );
+ K1table = calloc( 65536, K1TABLEWIDTH );
if( K1table == NULL )
{
return -1;
@@ -1195,8 +1194,7 @@
}
/* Initing our Really big table */
- BigTable = malloc( 16777216 * sizeof(int) );
- memset( BigTable, 0 , 16777216 * sizeof(int) );
+ BigTable = calloc( 16777216, sizeof(int) );
if( BigTable == NULL )
{
free( K1table );
this also fixes the fairly nonsense NULL checks that are done after we
would have crashed in memset...
Index: src/css.c
===================================================================
--- src/css.c (revision 255)
+++ src/css.c (working copy)
@@ -1163,8 +1163,7 @@
*/
/* initialize lookup tables for k[1] */
- K1table = malloc( 65536 * K1TABLEWIDTH );
- memset( K1table, 0 , 65536 * K1TABLEWIDTH );
+ K1table = calloc( 65536, K1TABLEWIDTH );
if( K1table == NULL )
{
return -1;
@@ -1195,8 +1194,7 @@
}
/* Initing our Really big table */
- BigTable = malloc( 16777216 * sizeof(int) );
- memset( BigTable, 0 , 16777216 * sizeof(int) );
+ BigTable = calloc( 16777216, sizeof(int) );
if( BigTable == NULL )
{
free( K1table );