提交 9372edd6 编写于 作者: B Behdad Esfahbod 提交者: Behdad Esfahbod

Use calloc(), instead of malloc()ing and memset()ing.

2009-01-29  Behdad Esfahbod  <behdad@gnome.org>

        * pango/opentype/harfbuzz-impl.c (_hb_alloc): Use calloc(),
        instead of malloc()ing and memset()ing.
上级 94c21d26
...@@ -38,11 +38,9 @@ _hb_alloc( HB_UInt size, ...@@ -38,11 +38,9 @@ _hb_alloc( HB_UInt size,
if ( size > 0 ) if ( size > 0 )
{ {
block = malloc( size ); block = calloc( 1, size );
if ( !block ) if ( !block )
error = ERR(HB_Err_Out_Of_Memory); error = ERR(HB_Err_Out_Of_Memory);
else
memset( (char*)block, 0, (size_t)size );
} }
*perror = error; *perror = error;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册