[inih] Change void* to FILE*
UBSan was complaining about a function type mismatch on a call to an
ini_reader. The function shoulod essentially match the prototype for
fgets, but differs in the last argument which should be a FILE*.
Bug: 128274
Change-Id: I34ba7fc90d087ba6e48bcf95c48c1a066bf16ad2
diff --git a/INIReader.h b/INIReader.h
index d7be51c..c85410c 100644
--- a/INIReader.h
+++ b/INIReader.h
@@ -28,7 +28,7 @@
const char* name, const char* value);
/* Typedef for prototype of fgets-style reader function. */
-typedef char* (*ini_reader)(char* str, int num, void* stream);
+typedef char* (*ini_reader)(char* str, int num, FILE* stream);
/* Parse given INI-style file. May have [section]s, name=value pairs
(whitespace stripped), and comments starting with ';' (semicolon). Section
@@ -166,7 +166,7 @@
}
/* See documentation in header file. */
-inline int ini_parse_stream(ini_reader reader, void* stream, ini_handler handler,
+inline int ini_parse_stream(ini_reader reader, FILE* stream, ini_handler handler,
void* user)
{
/* Uses a fair bit of stack (use heap instead if you need to) */