Unified · Split
| @@ -48,7 +48,7 @@ surf2k8(SDL_Surface *s) · 47 unmodified lines | ||
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | static int |
| 51 | −pjwit(int f, char *s, int scale) | |
| 51 | +pjwit(int f, char *s, int ssz, int scale) | |
| 52 | 52 | { |
| 53 | 53 | SDL_Surface *g, *line; |
| 54 | 54 | int dummy, advance, r; |
| @@ -79,13 +79,13 @@ pjwit(int f, char *s, int scale) · 24 unmodified lines | ||
| 79 | 79 | if(b == NULL) |
| 80 | 80 | goto err; |
| 81 | 81 | |
| 82 | − sprintf(s, "%s.%X-%X", opath, 0, 0); | |
| 82 | + snprintf(s, ssz, "%s.%X-%X", opath, 0, 0); | |
| 83 | 83 | memset(&fc, 0, sizeof(fc)); |
| 84 | 84 | fc.width = advance; |
| 85 | 85 | fc.bottom = line->h; |
| 86 | 86 | if(savesubfont(b, line->w, line->h, TTF_FontAscent(pf), 1, &fc, 1, s) != 0) |
| 87 | 87 | goto err2; |
| 88 | − sprintf(s, "%s.%X-%X", opath, Substitute, Substitute); | |
| 88 | + snprintf(s, ssz, "%s.%X-%X", opath, Substitute, Substitute); | |
| 89 | 89 | if(savesubfont(b, line->w, line->h, TTF_FontAscent(pf), 1, &fc, 1, s) != 0) |
| 90 | 90 | goto err2; |
| 91 | 91 | |
| @@ -110,7 +110,7 @@ err2: · 18 unmodified lines | ||
| 110 | 110 | int |
| 111 | 111 | main(int argc, char **argv) |
| 112 | 112 | { |
| 113 | − int c, optend, nr, i, fdfont; | |
| 113 | + int c, optend, nr, i, fdfont, ssz; | |
| 114 | 114 | int minx, maxx, advance, dummy, w, h, maxh, pjwface, hdr, scale; |
| 115 | 115 | struct parg_state ps; |
| 116 | 116 | Range *ranges, *rn; |
| @@ -206,8 +206,8 @@ usage: · 89 unmodified lines | ||
| 206 | 206 | opath = argv[argc-1]; |
| 207 | 207 | |
| 208 | 208 | i = strlen(opath); |
| 209 | − s = malloc(i+64); | |
| 210 | − sprintf(s, "%s.font", opath); | |
| 209 | + s = malloc(ssz = i+64); | |
| 210 | + snprintf(s, ssz, "%s.font", opath); | |
| 211 | 211 | |
| 212 | 212 | if((prefix = strrchr(s, '/')) == NULL) |
| 213 | 213 | prefix = s; |
| @@ -346,7 +346,7 @@ done: · 132 unmodified lines | ||
| 346 | 346 | dst.x += advance; |
| 347 | 347 | SDL_FreeSurface(g); |
| 348 | 348 | } |
| 349 | − sprintf(s, "%s.%X-%X", opath, rn->min, rn->max); | |
| 349 | + snprintf(s, ssz, "%s.%X-%X", opath, rn->min, rn->max); | |
| 350 | 350 | b = surf2k8(line); |
| 351 | 351 | if(savesubfont(b, line->w, line->h, TTF_FontAscent(f), scale, cs, ncs, s) != 0) |
| 352 | 352 | return 1; |
| @@ -360,7 +360,7 @@ done: · 7 unmodified lines | ||
| 360 | 360 | } |
| 361 | 361 | |
| 362 | 362 | if(pjwface) |
| 363 | − pjwit(fdfont, s, scale); | |
| 363 | + pjwit(fdfont, s, ssz, scale); | |
| 364 | 364 | |
| 365 | 365 | /* actual height of the font might be slightly different, so rewrite it */ |
| 366 | 366 | lseek(fdfont, 0, 0); |