Ignore:
Timestamp:
Jan 5, 2005, 1:18:49 AM (16 years ago)
Author:
Sam Hocevar
Message:
  • keep the font loaded across decodings.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pwntcha/trunk/src/phpbb.c

    r418 r421  
    2020/* Our macros */
    2121#define FONTNAME "share/font_phpbb.png"
     22static struct image *font = NULL;
    2223
    2324/* Main function */
     
    2728    char *result;
    2829    struct image *tmp1, *tmp2, *tmp3;
    29     struct image *font = image_load(FONTNAME);
    3030    int x, y, i = 0;
    3131    int r, g, b;
     
    3535    if(!font)
    3636    {
    37         fprintf(stderr, "cannot load font %s\n", FONTNAME);
    38         exit(-1);
     37        font = image_load(FONTNAME);
     38        if(!font)
     39        {
     40            fprintf(stderr, "cannot load font %s\n", FONTNAME);
     41            exit(-1);
     42        }
    3943    }
    4044
     
    126130    image_free(tmp2);
    127131    image_free(tmp3);
    128     image_free(font);
    129132
    130133    return result;
Note: See TracChangeset for help on using the changeset viewer.