diff options
Diffstat (limited to 'src/encparse.c')
-rw-r--r-- | src/encparse.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/encparse.c b/src/encparse.c index c304856..2e24475 100644 --- a/src/encparse.c +++ b/src/encparse.c @@ -20,7 +20,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/* $XFree86: xc/lib/font/fontfile/encparse.c,v 1.19 2003/12/19 02:05:38 dawes Exp $ */ +/* $XFree86: xc/lib/font/fontfile/encparse.c,v 1.20 2004/02/11 21:11:19 dawes Exp $ */ /* Parser for encoding files */ @@ -837,6 +837,7 @@ FontEncReallyReallyLoad(const char *charset, char file_name[MAXFONTFILENAMELEN], encoding_name[MAXFONTNAMELEN], buf[MAXFONTFILENAMELEN]; int count, n; + static char format[24] = ""; /* As we don't really expect to open encodings that often, we don't take the trouble of caching encodings directories. */ @@ -852,8 +853,12 @@ FontEncReallyReallyLoad(const char *charset, } encoding = NULL; + if (!format[0]) { + sprintf(format, "%%%ds %%%d[^\n]\n", sizeof(encoding_name) - 1, + sizeof(file_name) - 1); + } for(;;) { - count = fscanf(file, "%s %[^\n]\n", encoding_name, file_name); + count = fscanf(file, format, encoding_name, file_name); if(count == EOF) break; if(count != 2) |