git.samba.org
/
rsync.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cf81788
)
Improved the vmefail() code.
author
Wayne Davison
<wayned@samba.org>
Thu, 9 Nov 2006 02:37:38 +0000
(
02:37
+0000)
committer
Wayne Davison
<wayned@samba.org>
Thu, 9 Nov 2006 02:37:38 +0000
(
02:37
+0000)
popt/system.h
patch
|
blob
|
history
diff --git
a/popt/system.h
b/popt/system.h
index 8d62df85242eea1bb0b5598ed80676b171b4ef2f..f835a58e862faea1cac57db298c272b114f889ff 100644
(file)
--- a/
popt/system.h
+++ b/
popt/system.h
@@
-98,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;
}