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

@ -22,6 +22,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include "tio/error.h"
char * current_time(void)
{
@ -33,7 +34,7 @@ char * current_time(void)
tmp = localtime(&t);
if (tmp == NULL)
{
printf("Error: Retrieving local time failed\n");
error_printf("Retrieving local time failed");
exit(EXIT_FAILURE);
}