projects
/
tinc
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b2cee41
)
Fix reading configuration files that do not end with a newline.
author
Guus Sliepen
<guus@tinc-vpn.org>
Sat, 25 Oct 2008 18:10:08 +0000
(18:10 +0000)
committer
Guus Sliepen
<guus@tinc-vpn.org>
Sat, 25 Oct 2008 18:10:08 +0000
(18:10 +0000)
src/conf.c
patch
|
blob
|
history
diff --git
a/src/conf.c
b/src/conf.c
index
5681033
..
6ee54f5
100644
(file)
--- a/
src/conf.c
+++ b/
src/conf.c
@@
-343,6
+343,11
@@
int read_config_file(avl_tree_t *config_tree, const char *fname)
buffer = xmalloc(bufsize);
for(;;) {
+ if(feof(fp)) {
+ err = 0;
+ break;
+ }
+
line = readline(fp, &buffer, &bufsize);
if(!line) {
@@
-350,11
+355,6
@@
int read_config_file(avl_tree_t *config_tree, const char *fname)
break;
}
- if(feof(fp)) {
- err = 0;
- break;
- }
-
lineno++;
if(!*line || *line == '#')