forked from Imagelibrary/rtems
Avoid need for -fno-builtin for calloc()
Use RTEMS_OBFUSCATE_VARIABLE() instead.
This commit is contained in:
@@ -21,6 +21,7 @@
|
|||||||
#if defined(RTEMS_NEWLIB) && !defined(HAVE_CALLOC)
|
#if defined(RTEMS_NEWLIB) && !defined(HAVE_CALLOC)
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <rtems/score/basedefs.h>
|
||||||
|
|
||||||
void *calloc(
|
void *calloc(
|
||||||
size_t nelem,
|
size_t nelem,
|
||||||
@@ -32,6 +33,7 @@ void *calloc(
|
|||||||
|
|
||||||
length = nelem * elsize;
|
length = nelem * elsize;
|
||||||
cptr = malloc( length );
|
cptr = malloc( length );
|
||||||
|
RTEMS_OBFUSCATE_VARIABLE( cptr );
|
||||||
if ( cptr )
|
if ( cptr )
|
||||||
memset( cptr, '\0', length );
|
memset( cptr, '\0', length );
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user