/*
**    Name: rmacalloc.c
**
**    Date: Sun Jan  5 16:31:45 2003
**
*/

#include "rmamem.h"
#include <string.h>
#include "cserrno.h"

char *rmadebugcalloc(int line,char *file,size_t nmemb,size_t size)
    {
    char *ptr;

    if (size != 0 && nmemb > (size_t)-1 / size)
    {
        errno = ENOMEM;
        return NULL;
    }

    ptr = rmadebugmalloc(line,file,nmemb * size);
    if (ptr != NULL)
        {
        memset(ptr,0,nmemb * size);
        }

    return ptr;
    }
