Closed XavierBerger closed 9 years ago
I don't have a setup with an actual camera handy, especially with Ubuntu 14.04, but I think I know what the problem is: we shouldn't be setting *c->dst to NULL for non-string types. Can you try it with the following patch instead:
diff --git a/src/config.c b/src/config.c
index 47762d5..9d25542 100644
--- a/src/config.c
+++ b/src/config.c
@@ -157,7 +157,9 @@ void add_config_item(struct config *con, signed char short_name, char *long_name
c->long_option.flag = NULL;
c->long_option.val = c->short_name;
- *c->dst = NULL;
+ if (dst_type == CONFIG_STR) {
+ *c->dst = NULL;
+ }
con->count++;
Let me know if this works better. Just for fun, can you try compiling it using clang instead of gcc? Just modify src/Makefile to do that.
Your fix works perfectly both on Ubuntu and Raspbian.
I didn't tried clang
since it is not installed on my PC.
Closing since I pushed a different bug fix earlier.
dst
variable is set toNULL
after initialization of settings but in some circonstance, the variable is still used (log_level
,format
,...) and was causing the segfault.