projects
/
project
/
opkg-lede.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a65b6cb
)
libopkg: fix pkg_set_ptr() to properly set NULL pointers
author
Jo-Philipp Wich
<jo@mein.io>
Thu, 16 Feb 2017 10:46:31 +0000
(11:46 +0100)
committer
Jo-Philipp Wich
<jo@mein.io>
Thu, 16 Feb 2017 16:02:30 +0000
(17:02 +0100)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
libopkg/pkg.h
patch
|
blob
|
history
diff --git
a/libopkg/pkg.h
b/libopkg/pkg.h
index 3237f839e1bd725882c08d59a500ca2ae6a622f8..d9cab552826b3d3f2328f91cffab0d3bca676f6e 100644
(file)
--- a/
libopkg/pkg.h
+++ b/
libopkg/pkg.h
@@
-198,7
+198,8
@@
static inline char *pkg_get_string(const pkg_t *pkg, int id)
static inline void * pkg_set_ptr(pkg_t *pkg, int id, void *ptr)
{
- return ptr ? *(void **) pkg_set_raw(pkg, id, &ptr, sizeof(ptr)) : NULL;
+ void **res = pkg_set_raw(pkg, id, &ptr, sizeof(ptr));
+ return res ? *res : NULL;
}
static inline void * pkg_get_ptr(const pkg_t *pkg, int id)