From f4f1db9d616de9281ebac66e2755bebbf21b7dae Mon Sep 17 00:00:00 2001 From: erdgeist <> Date: Mon, 15 Jul 2013 18:45:27 +0000 Subject: Only complain about config file not found, not about formats file --- vchat-client.c | 8 ++++---- vchat.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/vchat-client.c b/vchat-client.c index d5960a5..71a596c 100755 --- a/vchat-client.c +++ b/vchat-client.c @@ -171,7 +171,7 @@ static void parseknownhosts(char *line) { /* load config file */ void -loadcfg (char *file,void (*lineparser) (char *)) +loadcfg (char *file,int complain, void (*lineparser) (char *)) { FILE *fh; #define BUFSIZE 4096 @@ -186,7 +186,7 @@ loadcfg (char *file,void (*lineparser) (char *)) free( tildex ); if (!fh) { - snprintf (errstr, TMPSTRSIZE, "Can't open config-file \"%s\": %s.", file, strerror(errno)); + if( complain ) snprintf (errstr, TMPSTRSIZE, "Can't open config-file \"%s\": %s.", file, strerror(errno)); return; } @@ -202,13 +202,13 @@ loadcfg (char *file,void (*lineparser) (char *)) void loadconfig (char *file) { - loadcfg(file,parsecfg); + loadcfg(file,1,parsecfg); } void loadformats (char *file) { - loadcfg(file,parseformats); + loadcfg(file,0,parseformats); } /* get-format-string */ diff --git a/vchat.h b/vchat.h index 541fd21..7b6e0d3 100755 --- a/vchat.h +++ b/vchat.h @@ -80,7 +80,7 @@ extern unsigned int loggedin; #define ERRSTRSIZE 1024 extern char errstr[]; extern char *vchat_cl_version; -void loadcfg (char *file,void (*lineparser) (char *)); +void loadcfg (char *file,int complain,void (*lineparser) (char *)); void loadformats (char *file); void cleanup(int signal); -- cgit v1.2.3