~ubuntu-branches/ubuntu/wily/luatex/wily

« back to all changes in this revision

Viewing changes to source/texk/kpathsea/xcalloc.c

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Preining
  • Date: 2010-04-29 00:47:19 UTC
  • mfrom: (1.1.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20100429004719-o42etkqe90n97b9e
Tags: 0.60.1-1
* new upstream release, adapt build-script patch
* disable patch: upstream-epstopdf_cc_no_xpdf_patching, included upstream
* disable patch: libpoppler-0.12, not needed anymore

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* xcalloc.c: calloc with error checking.
2
2
 
3
 
   Copyright 1992, 1993, 2008 Karl Berry.
 
3
   Copyright 1992, 1993, 2008, 2010 Karl Berry.
4
4
   Copyright 2005 Olaf Weber.
5
5
 
6
6
   This library is free software; you can redistribute it and/or
20
20
 
21
21
 
22
22
void *
23
 
xcalloc (unsigned nelem,  unsigned elsize)
 
23
xcalloc (size_t nelem,  size_t elsize)
24
24
{
25
 
    void *new_mem = (void*)calloc(nelem, elsize);
 
25
    void *new_mem = (void*)calloc(nelem ? nelem : 1, elsize ? elsize : 1);
26
26
  
27
27
    if (new_mem == NULL) {
28
28
        fprintf(stderr,
29
 
                "xcalloc: request for %u elements of size %u failed.\n",
30
 
                nelem, elsize);
 
29
                "xcalloc: request for %lu elements of size %lu failed.\n",
 
30
                (unsigned long)nelem, (unsigned long)elsize);
31
31
        exit(EXIT_FAILURE);
32
32
    }
33
33