Changed the behaviour if trying to realloc a memory chunk of size 0 to
be consistent across systems (an error would be generated on Ubuntu when no primers found)
This commit is contained in:
@ -54,8 +54,14 @@ void *eco_realloc(void *chunk,
|
|||||||
{
|
{
|
||||||
void *newchunk;
|
void *newchunk;
|
||||||
|
|
||||||
newchunk = realloc(chunk,newsize);
|
if (newsize == 0)
|
||||||
|
{
|
||||||
|
if (chunk)
|
||||||
|
free(chunk);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
newchunk = realloc(chunk,newsize);
|
||||||
|
|
||||||
if (!newchunk)
|
if (!newchunk)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user