mirror of
https://git.zx2c4.com/cgit
synced 2025-08-04 01:54:28 +02:00
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>
This commit is contained in:
parent
820df9c660
commit
50e70d32f0
2 changed files with 35 additions and 31 deletions
|
@ -1,6 +1,8 @@
|
|||
#ifndef CONFIGFILE_H
|
||||
#define CONFIGFILE_H
|
||||
|
||||
#include "cgit.h"
|
||||
|
||||
typedef void (*configfile_value_fn)(const char *name, const char *value);
|
||||
|
||||
extern int parse_configfile(const char *filename, configfile_value_fn fn);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue