Commit 2192b2830337c5420f58a689271de0e5adbca710
Check line number of error so that this works with libconfig-1.3.2 in CentOS6
James Hogarth committed on 4/17/2015, 10:40:57 PMParent: 77a74f0c52b1b936bf0131b06d78489631a615a6
Files changed
sslh-main.c | changed |
sslh-main.c | ||
---|---|---|
@@ -279,9 +279,12 @@ | ||
279 | 279 | const char* str; |
280 | 280 | |
281 | 281 | config_init(&config); |
282 | 282 | if (config_read_file(&config, filename) == CONFIG_FALSE) { |
283 | - if (config_error_type(&config) == CONFIG_ERR_PARSE) { | |
283 | +/* If it's a parse error then there will be a line number for the failure | |
284 | + * an I/O error (such as non-existent file) will have the error line as 0 | |
285 | + */ | |
286 | + if (config_error_line(&config) != 0) { | |
284 | 287 | fprintf(stderr, "%s:%d:%s\n", |
285 | 288 | filename, |
286 | 289 | config_error_line(&config), |
287 | 290 | config_error_text(&config)); |
Built with git-ssb-web