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/linuxfr.c

    r420 r421  
    1919
    2020#define FONTNAME "share/font_linuxfr.png"
     21static struct image *font = NULL;
    2122
    2223/* Main function */
     
    2728                 "0123456789";
    2829    char *result;
    29     struct image *tmp, *font;
     30    struct image *tmp;
    3031    int x, y, r, g, b, i, j, c;
    3132    int stats[40];
    3233
    33     font = image_load(FONTNAME);
    3434    if(!font)
    3535    {
    36         fprintf(stderr, "cannot load font %s\n", FONTNAME);
    37         exit(-1);
     36        font = image_load(FONTNAME);
     37        if(!font)
     38        {
     39            fprintf(stderr, "cannot load font %s\n", FONTNAME);
     40            exit(-1);
     41        }
    3842    }
    3943
     
    142146
    143147    image_free(tmp);
    144     image_free(font);
    145148
    146149    if(strlen(result) != 7)
Note: See TracChangeset for help on using the changeset viewer.