chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cgroup: rename cg_update_unified() → cg_unified_update()
[elogind.git]
/
src
/
basic
/
string-util.c
diff --git
a/src/basic/string-util.c
b/src/basic/string-util.c
index ebe146b03d817eab23e85990ce121fcf7c5a7b37..9b060a9a20dbb181f715bf348c741275dff0e209 100644
(file)
--- a/
src/basic/string-util.c
+++ b/
src/basic/string-util.c
@@
-218,7
+218,7
@@
char *strappend(const char *s, const char *suffix) {
return strnappend(s, suffix, suffix ? strlen(suffix) : 0);
}
return strnappend(s, suffix, suffix ? strlen(suffix) : 0);
}
-char *strjoin(const char *x, ...) {
+char *strjoin
_real
(const char *x, ...) {
va_list ap;
size_t l;
char *r, *p;
va_list ap;
size_t l;
char *r, *p;
@@
-825,6
+825,7
@@
int free_and_strdup(char **p, const char *s) {
return 1;
}
return 1;
}
+#if !HAVE_DECL_EXPLICIT_BZERO
/*
* Pointer to memset is volatile so that compiler must de-reference
* the pointer and can't assume that it points to any function in
/*
* Pointer to memset is volatile so that compiler must de-reference
* the pointer and can't assume that it points to any function in
@@
-835,19
+836,19
@@
typedef void *(*memset_t)(void *,int,size_t);
static volatile memset_t memset_func = memset;
static volatile memset_t memset_func = memset;
-void
* memory_erase
(void *p, size_t l) {
-
return memset_func(p, 'x
', l);
+void
explicit_bzero
(void *p, size_t l) {
+
memset_func(p, '\0
', l);
}
}
+#endif
char* string_erase(char *x) {
char* string_erase(char *x) {
-
if (!x)
return NULL;
/* A delicious drop of snake-oil! To be called on memory where
* we stored passphrases or so, after we used them. */
if (!x)
return NULL;
/* A delicious drop of snake-oil! To be called on memory where
* we stored passphrases or so, after we used them. */
-
- return
memory_erase(x, strlen(x))
;
+ explicit_bzero(x, strlen(x));
+ return
x
;
}
char *string_free_erase(char *s) {
}
char *string_free_erase(char *s) {