diff options
author | james <> | 2008-03-07 13:16:02 +0000 |
---|---|---|
committer | james <> | 2008-03-07 13:16:02 +0000 |
commit | be42afab1c325fae5c3c270876a3447220adcca5 (patch) | |
tree | bc1a2e2f73defb90dec0990cb849b51dd0e50dfe /src/util.c | |
parent | fc0af42eb82bf94a9b1174d3ba96536238bc5fcd (diff) | |
download | sympathy-be42afab1c325fae5c3c270876a3447220adcca5.tar.gz sympathy-be42afab1c325fae5c3c270876a3447220adcca5.tar.bz2 sympathy-be42afab1c325fae5c3c270876a3447220adcca5.zip |
*** empty log message ***
Diffstat (limited to 'src/util.c')
-rw-r--r-- | src/util.c | 29 |
1 files changed, 29 insertions, 0 deletions
@@ -10,6 +10,9 @@ static char rcsid[] = "$Id$"; /* * $Log$ + * Revision 1.10 2008/03/07 13:16:02 james + * *** empty log message *** + * * Revision 1.9 2008/03/07 12:37:04 james * *** empty log message *** * @@ -166,3 +169,29 @@ fput_cp (FILE * f, uint32_t ch) return fwrite (buf, i, 1, f); } + +void crash_out(char *why) +{ +terminal_atexit(); +fprintf(stderr,"sympathy is aborting: %s\n",why ? why:""); +exit(1); +} + +void *xmalloc(size_t s) +{ +void *ret=malloc(s); +if (!ret) crash_out("malloc failed"); +return ret; +} +void *xrealloc(void *p,size_t s) +{ +p=realloc(p,s); +if (!p) crash_out("realloc failed"); +return p; +} +char *xstrdup(const char *s) +{ +char *ret=strdup(s); +if (!ret) crash_out("strdup failed"); +return ret; +} |