| @@ -13,7 +13,7 @@ | |||||
| #include "config.h" | #include "config.h" | ||||
| #if !defined(__KERNEL__) | #if !defined(__KERNEL__) | ||||
| # include <time.h> | |||||
| # include <time.h> | |||||
| # include <stdio.h> | # include <stdio.h> | ||||
| # include <string.h> | # include <string.h> | ||||
| # include <stdlib.h> | # include <stdlib.h> | ||||
| @@ -52,11 +52,11 @@ static void version(void) | |||||
| static char* get_date(char *format) { | static char* get_date(char *format) { | ||||
| time_t currtime; | |||||
| char *charTime = malloc(101); | |||||
| time_t currtime; | |||||
| char *charTime = malloc(101); | |||||
| time(&currtime); | |||||
| strftime(charTime, 100,format,localtime(&currtime)); | |||||
| time(&currtime); | |||||
| strftime(charTime, 100,format,localtime(&currtime)); | |||||
| return charTime; | return charTime; | ||||
| } | } | ||||
| @@ -68,7 +68,7 @@ int main(int argc, char *argv[]) { | |||||
| caca_display_t *dp; | caca_display_t *dp; | ||||
| uint32_t w, h, fw, fh; | uint32_t w, h, fw, fh; | ||||
| char *format = "%R:%S"; | |||||
| char *format = "%R:%S"; | |||||
| char *font = "/usr/share/figlet/mono12.tlf"; | char *font = "/usr/share/figlet/mono12.tlf"; | ||||
| @@ -114,13 +114,13 @@ int main(int argc, char *argv[]) { | |||||
| cv = caca_create_canvas(0, 0); | cv = caca_create_canvas(0, 0); | ||||
| figcv = caca_create_canvas(0, 0); | figcv = caca_create_canvas(0, 0); | ||||
| if(!cv || !figcv) | if(!cv || !figcv) | ||||
| { | |||||
| { | |||||
| fprintf(stderr, "%s: unable to initialise libcaca\n", argv[0]); | fprintf(stderr, "%s: unable to initialise libcaca\n", argv[0]); | ||||
| return 1; | return 1; | ||||
| } | } | ||||
| if(caca_canvas_set_figfont(figcv, font)) | if(caca_canvas_set_figfont(figcv, font)) | ||||
| { | |||||
| { | |||||
| fprintf(stderr, "Could not open font\n"); | fprintf(stderr, "Could not open font\n"); | ||||
| return -1; | return -1; | ||||
| } | } | ||||
| @@ -139,7 +139,7 @@ int main(int argc, char *argv[]) { | |||||
| while(caca_get_event(dp, CACA_EVENT_KEY_PRESS | while(caca_get_event(dp, CACA_EVENT_KEY_PRESS | ||||
| | CACA_EVENT_QUIT, &ev, 1)) | | CACA_EVENT_QUIT, &ev, 1)) | ||||
| { | |||||
| { | |||||
| if(caca_get_event_type(&ev)) | if(caca_get_event_type(&ev)) | ||||
| goto end; | goto end; | ||||
| } | } | ||||
| @@ -153,7 +153,7 @@ int main(int argc, char *argv[]) { | |||||
| caca_clear_canvas(cv); | caca_clear_canvas(cv); | ||||
| caca_clear_canvas(figcv); | caca_clear_canvas(figcv); | ||||
| while(d[o]) | while(d[o]) | ||||
| { | |||||
| { | |||||
| caca_put_figchar(figcv, d[o++]); | caca_put_figchar(figcv, d[o++]); | ||||
| } | } | ||||
| caca_flush_figlet (figcv); | caca_flush_figlet (figcv); | ||||