Ignore:
Timestamp:
Oct 26, 2006, 11:24:29 AM (14 years ago)
Author:
Sam Hocevar
Message:
  • Put at least one space in empty IRC lines otherwise most clients won't output them.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/cucul/export.c

    r1237 r1239  
    505505    unsigned int x, y;
    506506
    507     /* 16 bytes assumed for max length per pixel. Worst case scenario:
     507    /* 14 bytes assumed for max length per pixel. Worst case scenario:
    508508     * ^Cxx,yy   6 bytes
    509509     * ^B^B      2 bytes
    510510     * ch        6 bytes
     511     * 3 bytes for max length per line. Worst case scenario:
     512     * <spc>     1 byte (for empty lines)
    511513     * \r\n      2 bytes
    512514     * In real life, the average bytes per pixel value will be around 5.
    513515     */
    514516
    515     ex->size = 2 + (cv->width * cv->height * 16);
     517    ex->size = 2 + cv->height * (3 + cv->width * 14);
    516518    ex->data = malloc(ex->size);
    517519
     
    583585            prevbg = bg;
    584586        }
     587
     588        /* TODO: do the same the day we optimise whole lines above */
     589        if(!cv->width)
     590            *cur++ = ' ';
     591
    585592        *cur++ = '\r';
    586593        *cur++ = '\n';
Note: See TracChangeset for help on using the changeset viewer.