#include #include #include "test.h" /* this is a well behaved program that prints out a smiley face */ int main() { #if defined(COVERAGE) assert(!covsrv_init()); atexit(covsrv_destroy); #endif /* alloc memory for the smiley */ char *p = mallocc(2 * sizeof(char)); if (!p) { fprintf(stderr, "oops, malloc failed :(\n"); return -1; } p[0] = ':'; p[1] = ')'; /* oops, forgot the terminating null, let's realloc * (but in a dangerous way) */ p = reallocc(p, 3 * sizeof(char)); p[2] = '\0'; printf("%s\n", p); free(p); }