Quellcode durchsuchen

* examples/cacaview.c:

+ If Imlib2 was not activated, warn the user that only BMP is supported.
tags/v0.99.beta14
Sam Hocevar sam vor 21 Jahren
Ursprung
Commit
fd2a676cd2
1 geänderte Dateien mit 7 neuen und 2 gelöschten Zeilen
  1. +7
    -2
      examples/cacaview.c

+ 7
- 2
examples/cacaview.c Datei anzeigen

@@ -267,15 +267,20 @@ int main(int argc, char **argv)
}
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;
int len = strlen(" Error loading `%s'. ") + strlen(list[current]);
int len = strlen(ERROR_STRING) + strlen(list[current]);

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

buffer = malloc(len);

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


Laden…
Abbrechen
Speichern