X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/89a0e3a927dff09070ef9454bc9215efaba91036..c8b823f9d8849a3bcb0ab9ffc85ff02c3d2eb367:/popt/system.h diff --git a/popt/system.h b/popt/system.h index 0579b8ca..f835a58e 100644 --- a/popt/system.h +++ b/popt/system.h @@ -89,12 +89,6 @@ char *alloca(size_t size); #define alloca __builtin_alloca #endif -/*@-redecl -redef@*/ -/*@mayexit@*/ /*@only@*/ /*@unused@*/ -char * xstrdup (const char *str) - /*@*/; -/*@=redecl =redef@*/ - #ifndef HAVE_STRLCPY size_t strlcpy(char *d, const char *s, size_t bufsize); #endif @@ -104,13 +98,15 @@ size_t strlcat(char *d, const char *s, size_t bufsize); #endif #if HAVE_MCHECK_H && defined(__GNUC__) -#define vmefail() (fprintf(stderr, "virtual memory exhausted.\n"), exit(EXIT_FAILURE), NULL) static inline char * xstrdup(const char *s) { size_t memsize = strlen(s) + 1; char *ptr = malloc(memsize); - if (!ptr) vmefail(); + if (!ptr) { + fprintf(stderr, "virtual memory exhausted.\n"); + exit(EXIT_FAILURE); + } strlcpy(ptr, s, memsize); return ptr; }