From 0b1b9f59f2513f5e2795cba34c747b0e68f4b9b1 Mon Sep 17 00:00:00 2001 From: Kaleb Keithley Date: Mon, 23 Feb 2004 21:34:47 +0000 Subject: merge most of XFree86 RC3 (4.3.99.903) from vendor branch. bug #214 --- src/encparse.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/encparse.c b/src/encparse.c index e4c9a7e..2e24475 100644 --- a/src/encparse.c +++ b/src/encparse.c @@ -20,8 +20,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/* $XdotOrg: 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.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 */ @@ -838,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. */ @@ -853,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) -- cgit v1.2.3