Don't use unitialized variable fontpath
Font path operations moved to FIGopen(), error messages changed to use fontname. Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
This commit is contained in:
parent
8e9b51e5c5
commit
0d2908b98c
6
figlet.c
6
figlet.c
@ -1177,7 +1177,7 @@ void readfont()
|
|||||||
inchr theord;
|
inchr theord;
|
||||||
int maxlen,cmtlines,ffright2left;
|
int maxlen,cmtlines,ffright2left;
|
||||||
int smush,smush2;
|
int smush,smush2;
|
||||||
char *fontpath,fileline[MAXLEN+1],magicnum[5];
|
char fileline[MAXLEN+1],magicnum[5];
|
||||||
ZFILE *fontfile;
|
ZFILE *fontfile;
|
||||||
|
|
||||||
fontfile = FIGopen(fontname,FONTFILESUFFIX);
|
fontfile = FIGopen(fontname,FONTFILESUFFIX);
|
||||||
@ -1205,7 +1205,7 @@ void readfont()
|
|||||||
&ffright2left,&smush2);
|
&ffright2left,&smush2);
|
||||||
|
|
||||||
if (maxlen > MAXLEN) {
|
if (maxlen > MAXLEN) {
|
||||||
fprintf(stderr,"%s: %s: character is too wide\n",myname,fontpath);
|
fprintf(stderr,"%s: %s: character is too wide\n",myname,fontname);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
#ifdef TLF_FONTS
|
#ifdef TLF_FONTS
|
||||||
@ -1214,7 +1214,7 @@ void readfont()
|
|||||||
#else
|
#else
|
||||||
if (strcmp(magicnum,FONTFILEMAGICNUMBER) || numsread<5) {
|
if (strcmp(magicnum,FONTFILEMAGICNUMBER) || numsread<5) {
|
||||||
#endif
|
#endif
|
||||||
fprintf(stderr,"%s: %s: Not a FIGlet 2 font file\n",myname,fontpath);
|
fprintf(stderr,"%s: %s: Not a FIGlet 2 font file\n",myname,fontname);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
for (i=1;i<=cmtlines;i++) {
|
for (i=1;i<=cmtlines;i++) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user