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

    r414 r421  
    1919
    2020#define FONTNAME "share/font_vbulletin.png"
     21static struct image *font = NULL;
    2122
    2223/* Main function */
     
    2526    char all[] = "2346789ABCDEFGHJKLMNPRTWXYZ";
    2627    char *result;
    27     struct image *tmp1, *tmp2, *tmp3, *font;
     28    struct image *tmp1, *tmp2, *tmp3;
    2829    int limits[6] = { 26, 53, 80, 107, 134, 160 };
    2930    int x, y, r, g, b, i, j;
    3031
    31     font = image_load(FONTNAME);
    3232    if(!font)
    3333    {
    34         fprintf(stderr, "cannot load font %s\n", FONTNAME);
    35         exit(-1);
     34        font = image_load(FONTNAME);
     35        if(!font)
     36        {
     37            fprintf(stderr, "cannot load font %s\n", FONTNAME);
     38            exit(-1);
     39        }
    3640    }
    3741
     
    135139    image_free(tmp2);
    136140    image_free(tmp3);
    137     image_free(font);
    138141
    139142    return result;
Note: See TracChangeset for help on using the changeset viewer.