Changeset 299 for libcaca/trunk/examples/cacaview.c
- Timestamp:
- Jan 1, 2004, 5:29:50 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/examples/cacaview.c
r291 r299 228 228 if(items && reload) 229 229 { 230 char *buffer = malloc(ww + 1); 230 char *buffer; 231 int len = strlen(" Loading `%s'... ") + strlen(list[current]); 232 233 if(len < ww + 1) 234 len = ww + 1; 235 236 buffer = malloc(len); 231 237 232 238 /* Reset image-specific runtime variables */ 233 239 zoom = 0; 234 240 235 s nprintf(buffer, ww, " Loading `%s'... ", list[current]);241 sprintf(buffer, " Loading `%s'... ", list[current]); 236 242 buffer[ww] = '\0'; 237 243 caca_set_color(CACA_COLOR_WHITE, CACA_COLOR_BLUE); … … 262 268 else if(!pixels) 263 269 { 264 char *buffer = malloc(ww + 1); 265 snprintf(buffer, ww, " Error loading `%s'. ", list[current]); 270 char *buffer; 271 int len = strlen(" Error loading `%s'. ") + strlen(list[current]); 272 273 if(len < ww + 1) 274 len = ww + 1; 275 276 buffer = malloc(len); 277 278 sprintf(buffer, " Error loading `%s'. ", list[current]); 266 279 buffer[ww] = '\0'; 267 280 caca_set_color(CACA_COLOR_WHITE, CACA_COLOR_BLUE); … … 323 336 "(zoom: %s%i)", zoom > 0 ? "+" : "", zoom); 324 337 325 caca_set_color(CACA_COLOR_LIGHT RED, CACA_COLOR_BLACK);338 caca_set_color(CACA_COLOR_LIGHTGRAY, CACA_COLOR_BLACK); 326 339 caca_draw_line(0, wh - 1, ww - 1, wh - 1, ' '); 327 340 switch(status)
Note: See TracChangeset
for help on using the changeset viewer.