Changeset e6b73ad0 in mainline


Ignore:
Timestamp:
2009-10-30T21:15:02Z (15 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
49647be
Parents:
c7dc8ad
Message:

calloc() should actually zero out the block.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/libc/generic/malloc.c

    rc7dc8ad re6b73ad0  
    355355void *calloc(const size_t nmemb, const size_t size)
    356356{
    357         return malloc(nmemb * size);
     357        void *block = malloc(nmemb * size);
     358        if (block == NULL)
     359                return NULL;
     360
     361        memset(block, 0, nmemb * size);
     362        return block;
    358363}
    359364
Note: See TracChangeset for help on using the changeset viewer.