chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
hexdecoct: use typesafe new() instead of malloc()
[elogind.git]
/
src
/
basic
/
hexdecoct.c
diff --git
a/src/basic/hexdecoct.c
b/src/basic/hexdecoct.c
index 6843aedd0a2b781bcd2821ace0a5584936a3252d..2d6e377f0a4062cbdc693d103bfb45a21a3c4b63 100644
(file)
--- a/
src/basic/hexdecoct.c
+++ b/
src/basic/hexdecoct.c
@@
-72,10
+72,10
@@
int unhexchar(char c) {
}
char *hexmem(const void *p, size_t l) {
- char *r, *z;
const uint8_t *x;
+ char *r, *z;
- z = r =
malloc(
l * 2 + 1);
+ z = r =
new(char,
l * 2 + 1);
if (!r)
return NULL;