Skip to content
This repository has been archived by the owner on Apr 18, 2023. It is now read-only.

Commit

Permalink
Use better error messages for s* (Thanks Curtis)
Browse files Browse the repository at this point in the history
  • Loading branch information
stapelberg committed Jun 27, 2009
1 parent 0d30710 commit eae0b18
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/util.c
Expand Up @@ -83,19 +83,19 @@ void die(char *fmt, ...) {
*/
void *smalloc(size_t size) {
void *result = malloc(size);
exit_if_null(result, "Too less memory for malloc(%d)\n", size);
exit_if_null(result, "Error: out of memory (malloc(%d))\n", size);
return result;
}

void *scalloc(size_t size) {
void *result = calloc(size, 1);
exit_if_null(result, "Too less memory for calloc(%d)\n", size);
exit_if_null(result, "Error: out of memory (calloc(%d))\n", size);
return result;
}

char *sstrdup(const char *str) {
char *result = strdup(str);
exit_if_null(result, "Too less memory for strdup()\n");
exit_if_null(result, "Error: out of memory (strdup())\n");
return result;
}

Expand Down

0 comments on commit eae0b18

Please sign in to comment.