chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3213845
)
hexdecoct: use typesafe new() instead of malloc()
author
Lennart Poettering
<lennart@poettering.net>
Wed, 1 Feb 2017 23:10:44 +0000
(
00:10
+0100)
committer
Sven Eden
<yamakuzure@gmx.net>
Mon, 17 Jul 2017 15:58:36 +0000
(17:58 +0200)
src/basic/hexdecoct.c
patch
|
blob
|
history
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;