diff options
author | Lukas Fleischer <cgit@cryptocrack.de> | 2013-06-04 23:47:53 (JST) |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2013-08-13 04:14:10 (JST) |
commit | 50e70d32f056c20db760328774d27524648fb739 (patch) | |
tree | f11c0bfac7b63143523faaa95e713d52a7cc1cf1 /configfile.h | |
parent | 820df9c66073b1345397642b46f1885b40b620e3 (diff) | |
download | cgit-50e70d32f056c20db760328774d27524648fb739.zip cgit-50e70d32f056c20db760328774d27524648fb739.tar.gz |
Use strbuf for reading configuration files
Use struct strbuf from Git instead of fixed-size buffers to remove the
limit on the length of configuration file lines and refactor
read_config_line() to improve readability.
Note that this also fixes a buffer overflow that existed with the
original fixed-size buffer implementation.
Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
Diffstat (limited to 'configfile.h')
-rw-r--r-- | configfile.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/configfile.h b/configfile.h index 04235e5..af7ca19 100644 --- a/configfile.h +++ b/configfile.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef CONFIGFILE_H | 1 | #ifndef CONFIGFILE_H |
2 | #define CONFIGFILE_H | 2 | #define CONFIGFILE_H |
3 | 3 | ||
4 | #include "cgit.h" | ||
5 | |||
4 | typedef void (*configfile_value_fn)(const char *name, const char *value); | 6 | typedef void (*configfile_value_fn)(const char *name, const char *value); |
5 | 7 | ||
6 | extern int parse_configfile(const char *filename, configfile_value_fn fn); | 8 | extern int parse_configfile(const char *filename, configfile_value_fn fn); |