Browse Source

* examples/cacaview.c:

+ If Imlib2 was not activated, warn the user that only BMP is supported.
tags/v0.99.beta14
Sam Hocevar sam 21 years ago
parent
commit
fd2a676cd2
1 changed files with 7 additions and 2 deletions
  1. +7
    -2
      examples/cacaview.c

+ 7
- 2
examples/cacaview.c View File

@@ -267,15 +267,20 @@ int main(int argc, char **argv)
} }
else if(!pixels) else if(!pixels)
{ {
#if defined(HAVE_IMLIB2_H)
# define ERROR_STRING " Error loading `%s'. "
#else
# define ERROR_STRING " Error loading `%s'. Only BMP is supported. "
#endif
char *buffer; char *buffer;
int len = strlen(" Error loading `%s'. ") + strlen(list[current]);
int len = strlen(ERROR_STRING) + strlen(list[current]);


if(len < ww + 1) if(len < ww + 1)
len = ww + 1; len = ww + 1;


buffer = malloc(len); buffer = malloc(len);


sprintf(buffer, " Error loading `%s'. ", list[current]);
sprintf(buffer, ERROR_STRING, list[current]);
buffer[ww] = '\0'; buffer[ww] = '\0';
caca_set_color(CACA_COLOR_WHITE, CACA_COLOR_BLUE); caca_set_color(CACA_COLOR_WHITE, CACA_COLOR_BLUE);
caca_putstr((ww - strlen(buffer)) / 2, wh / 2, buffer); caca_putstr((ww - strlen(buffer)) / 2, wh / 2, buffer);


Loading…
Cancel
Save