Cleanup of error handling

Introduced consistent way of handling errors and printing error messages.

Also upgraded some warnings to errors.
This commit is contained in:
Martin Lund 2016-05-09 17:28:43 +02:00
parent 4e2bcde010
commit ad551b363e
6 changed files with 106 additions and 81 deletions

View file

@ -25,11 +25,12 @@
#include <errno.h>
#include "tio/options.h"
#include "tio/print.h"
#include "tio/error.h"
char *error = "";
char error[1000];
void error_exit(void)
{
if ((error[0] != 0) && (option.no_autoconnect))
printf("Error: %s\n", error);
printf("\rError: %s\r\n", error);
}