Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Some minor tweaks:
[rsync/rsync.git]
/
popt
/
system.h
diff --git
a/popt/system.h
b/popt/system.h
index
0579b8c
..
f835a58
100644
(file)
--- a/
popt/system.h
+++ b/
popt/system.h
@@
-89,12
+89,6
@@
char *alloca(size_t size);
#define alloca __builtin_alloca
#endif
#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
#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__)
#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);
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;
}
strlcpy(ptr, s, memsize);
return ptr;
}