mirror of https://github.com/xzeldon/htop.git
Cleanse xStrdup mess
This commit is contained in:
parent
8b55113ea8
commit
736c496dbf
2
XAlloc.c
2
XAlloc.c
|
@ -67,7 +67,7 @@ int xSnprintf(char* buf, int len, const char* fmt, ...) {
|
||||||
return _n;
|
return _n;
|
||||||
}
|
}
|
||||||
|
|
||||||
char* xStrdup_(const char* str) {
|
char* xStrdup(const char* str) {
|
||||||
char* data = strdup(str);
|
char* data = strdup(str);
|
||||||
if (!data) {
|
if (!data) {
|
||||||
fail();
|
fail();
|
||||||
|
|
10
XAlloc.h
10
XAlloc.h
|
@ -25,14 +25,6 @@ int xAsprintf(char **strp, const char* fmt, ...);
|
||||||
ATTR_FORMAT(printf, 3, 4)
|
ATTR_FORMAT(printf, 3, 4)
|
||||||
int xSnprintf(char *buf, int len, const char* fmt, ...);
|
int xSnprintf(char *buf, int len, const char* fmt, ...);
|
||||||
|
|
||||||
#undef xStrdup
|
char* xStrdup(const char* str) ATTR_NONNULL;
|
||||||
#undef xStrdup_
|
|
||||||
#ifdef NDEBUG
|
|
||||||
# define xStrdup_ xStrdup
|
|
||||||
#else
|
|
||||||
# define xStrdup(str_) (assert(str_), xStrdup_(str_))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
char* xStrdup_(const char* str) ATTR_NONNULL;
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue