diff options
author | Luke Bratch <luke@bratch.co.uk> | 2019-05-30 22:02:07 +0100 |
---|---|---|
committer | Luke Bratch <luke@bratch.co.uk> | 2019-05-30 22:02:07 +0100 |
commit | fd33289346881b96841a598a1f8980212b0bab62 (patch) | |
tree | 2de9e0c65af5c2d138e3141c88fb826c0ea133dc /functions.c | |
parent | 6d183c02a50a42743c3031532f458ab5cea0685d (diff) |
Remove most (all?) exit()s with error handling without exiting where possible. Convert most remaining printing to stdout/stderr to debugprint() instead.
Diffstat (limited to 'functions.c')
-rw-r--r-- | functions.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/functions.c b/functions.c index 13b910b..dbcc54e 100644 --- a/functions.c +++ b/functions.c @@ -52,6 +52,7 @@ void updategreetingnick(char *greeting, char *greetingnum, char *newnick, char * char greetingtmp2[MAXDATASIZE]; if (!snprintf(greetingtmp2, MAXDATASIZE, "%s%s %s", greetingtmp, newnick, greeting + pos + strlen(oldnick) + 1)) { fprintf(stderr, "Error while preparing new greeting string!\n"); + debugprint(DEBUG_CRIT, "Error while preparing new greeting string!\n"); exit(1); } @@ -80,8 +81,7 @@ void debugprint(int level, char *format, ...) { int bytes = 0; fp = fopen(debugpath, "a"); if ((bytes = vfprintf(fp, format, args)) < 0) { - printf("error: could not write to debug file.\n"); - exit(1); + debugprint(DEBUG_CRIT, "error: could not write to debug file.\n"); } fclose(fp); |