|
Lines 52-62
static int lexc ( FILE *file );
Link Here
|
| 52 |
int |
52 |
int |
| 53 |
FontFileReadDirectory (char *directory, FontDirectoryPtr *pdir) |
53 |
FontFileReadDirectory (char *directory, FontDirectoryPtr *pdir) |
| 54 |
{ |
54 |
{ |
| 55 |
char file_name[MAXFONTFILENAMELEN]; |
55 |
char file_name[MAXFONTFILENAMELEN] = {0}; |
| 56 |
char font_name[MAXFONTNAMELEN]; |
56 |
char font_name[MAXFONTNAMELEN] = {0}; |
| 57 |
char dir_file[MAXFONTFILENAMELEN]; |
57 |
char dir_file[MAXFONTFILENAMELEN] = {0}; |
| 58 |
#ifdef FONTDIRATTRIB |
58 |
#ifdef FONTDIRATTRIB |
| 59 |
char dir_path[MAXFONTFILENAMELEN]; |
59 |
char dir_path[MAXFONTFILENAMELEN] = {0}; |
| 60 |
char *ptr; |
60 |
char *ptr; |
| 61 |
#endif |
61 |
#endif |
| 62 |
FILE *file; |
62 |
FILE *file; |
|
Lines 68-73
FontFileReadDirectory (char *directory,
Link Here
|
| 68 |
|
68 |
|
| 69 |
FontDirectoryPtr dir = NullFontDirectory; |
69 |
FontDirectoryPtr dir = NullFontDirectory; |
| 70 |
|
70 |
|
|
|
71 |
if (strlen(directory) + strlen(FontDirFile) + 1 >= sizeof(dir_file)) |
| 72 |
return BadFontPath; |
| 73 |
|
| 74 |
|
| 71 |
#ifdef FONTDIRATTRIB |
75 |
#ifdef FONTDIRATTRIB |
| 72 |
/* Check for font directory attributes */ |
76 |
/* Check for font directory attributes */ |
| 73 |
#ifndef __UNIXOS2__ |
77 |
#ifndef __UNIXOS2__ |
|
Lines 251-256
ReadFontAlias(char *directory, Bool isFi
Link Here
|
| 251 |
int status = Successful; |
255 |
int status = Successful; |
| 252 |
struct stat statb; |
256 |
struct stat statb; |
| 253 |
|
257 |
|
|
|
258 |
if (strlen(directory) + strlen(FontAliasFile) + 1 >= sizeof(alias_file)) |
| 259 |
return BadFontPath; |
| 260 |
|
| 254 |
dir = *pdir; |
261 |
dir = *pdir; |
| 255 |
strcpy(alias_file, directory); |
262 |
strcpy(alias_file, directory); |
| 256 |
if (!isFile) { |
263 |
if (!isFile) { |
|
Lines 286-291
ReadFontAlias(char *directory, Bool isFi
Link Here
|
| 286 |
status = AllocError; |
293 |
status = AllocError; |
| 287 |
break; |
294 |
break; |
| 288 |
case NAME: |
295 |
case NAME: |
|
|
296 |
if (strlen(lexToken) >= sizeof(alias)) { |
| 297 |
status = BadFontPath; |
| 298 |
break; |
| 299 |
} |
| 289 |
strcpy(alias, lexToken); |
300 |
strcpy(alias, lexToken); |
| 290 |
token = lexAlias(file, &lexToken); |
301 |
token = lexAlias(file, &lexToken); |
| 291 |
switch (token) { |
302 |
switch (token) { |
|
Lines 302-307
ReadFontAlias(char *directory, Bool isFi
Link Here
|
| 302 |
status = AllocError; |
313 |
status = AllocError; |
| 303 |
break; |
314 |
break; |
| 304 |
case NAME: |
315 |
case NAME: |
|
|
316 |
if (strlen(lexToken) >= sizeof(font_name)) { |
| 317 |
status = BadFontPath; |
| 318 |
break; |
| 319 |
} |
| 305 |
CopyISOLatin1Lowered(alias, alias, strlen(alias)); |
320 |
CopyISOLatin1Lowered(alias, alias, strlen(alias)); |
| 306 |
CopyISOLatin1Lowered(font_name, lexToken, strlen(lexToken)); |
321 |
CopyISOLatin1Lowered(font_name, lexToken, strlen(lexToken)); |
| 307 |
if (!FontFileAddFontAlias (dir, alias, font_name)) |
322 |
if (!FontFileAddFontAlias (dir, alias, font_name)) |