#include #include #include #include #include void * calloc (size_t bytes, size_t size) { void *result; static int cnt; if (cnt++) { fprintf(stderr, "Been there, done that.\n"); abort(); } result = malloc(bytes); if (result) return memset(result, 0, bytes); return result; } int main (int argc, char *argv[]) { if (argc != 2) return (1); size_t bytes = strtoul(argv[1], NULL, 10); return (calloc(bytes, 1) ? 42 : 0); }