How to do that?
The code is causing: null pointer dereference.
10-08 17:26:00.835 5249 5617 D DigestGenerator: /apex/com.android.runtime/lib/bionic/libc.so!libc.so (strstr+) ()
10-08 17:26:00.835 5249 5617 D DigestGenerator: XXbase.apk!libtest.so (test_bool(char const*)+) ()
bool test_bool(const char *filename) {
if (strstr(filename, "yes")) {
return true;
}
return false;
}
long *test_long(long number, ...) {
va_list args;
va_start(args, number);
for(int i=0; i<number; ++i) {
if (test_bool(va_arg(args, const char *))) {
//do something
return 0;
}
}
va_end(args);
//do something
return 0;
}
test_long(0, 1, "yes", 3);
test_long().printf()determines the types from the format string.test_long(0, 1, "yes", 3)- but1and3are not aconst char *. You can't callva_arg(.., const char*)when the argument is not aconst char*.template <typename... Args> long test_long(Args... args) { ... }