Forráskód Böngészése

libobs: Fix da_push_back taking a wrong type of item

Since the darray `sys_include_dirs` is an array of `char *`, it is
required to take a pointer to `char *`, that is `char **`. However,
`char *` was passed.
Since this function never called, another fix is removing entire
function `cf_preprocessor_add_sys_include_dir`.
Norihiro Kamae 4 éve
szülő
commit
7b4ae8611c
1 módosított fájl, 2 hozzáadás és 1 törlés
  1. 2 1
      libobs/util/cf-lexer.h

+ 2 - 1
libobs/util/cf-lexer.h

@@ -187,8 +187,9 @@ static inline void
 cf_preprocessor_add_sys_include_dir(struct cf_preprocessor *pp,
 				    const char *include_dir)
 {
+	char *str = bstrdup(include_dir);
 	if (include_dir)
-		da_push_back(pp->sys_include_dirs, bstrdup(include_dir));
+		da_push_back(pp->sys_include_dirs, &str);
 }
 
 EXPORT void cf_preprocessor_add_def(struct cf_preprocessor *pp,