projects
/
oweals
/
tinc.git
/ 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 568103373c9a5a1612c22cfa779143a5a04ce07c..6ee54f5a7f1644f639c931efd331a8525472d7f1 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 == '#')