From 84b91f70adbdbb4f3300c3917cbc3916aaf256aa Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Fri, 26 Jul 2002 03:22:53 +0000 Subject: [PATCH] Minor uniformity tweaks, use lutil_progname, don't use fscanf --- libraries/liblunicode/Makefile.in | 1 + libraries/liblunicode/ucdata/ucgendat.c | 11 +++++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libraries/liblunicode/Makefile.in b/libraries/liblunicode/Makefile.in index 5316d023ae..ef2e3614a0 100644 --- a/libraries/liblunicode/Makefile.in +++ b/libraries/liblunicode/Makefile.in @@ -14,6 +14,7 @@ SRCS = ucstr.c OBJS = ucdata.o ure.o urestubs.o ucstr.o XLIB = $(LIBRARY) +XLIBS = $(LDAP_LIBLUTIL_A) PROGRAMS = ucgendat LDAP_INCDIR= ../../include diff --git a/libraries/liblunicode/ucdata/ucgendat.c b/libraries/liblunicode/ucdata/ucgendat.c index dcb4a91a39..d4cb97b2de 100644 --- a/libraries/liblunicode/ucdata/ucgendat.c +++ b/libraries/liblunicode/ucdata/ucgendat.c @@ -806,7 +806,8 @@ read_cdata(FILE *in) lineno = skip = 0; while (!feof(in)) { - if( fscanf(in, "%[^\n]\n", line) != 1) break; + if( !fgets(line, sizeof(line), in)) break; + if( (s=strchr(line, '\n')) ) *s = '\0'; lineno++; /* @@ -1165,7 +1166,8 @@ read_compexdata(FILE *in) (void) memset((char *) compexs, 0, sizeof(unsigned long) << 11); while (!feof(in)) { - if( fscanf(in, "%[^\n]\n", line) != 1) break; + if( !fgets(line, sizeof(line), in)) break; + if( (s=strchr(line, '\n')) ) *s = '\0'; /* * Skip blank lines and lines that start with a '#'. */ @@ -1600,10 +1602,7 @@ main(int argc, char *argv[]) FILE *in; char *prog, *opath; - if ((prog = strrchr(argv[0], *LDAP_DIRSEP)) != 0) - prog++; - else - prog = argv[0]; + prog = lutil_progname( "ucgendat", argc, argv ); opath = 0; in = stdin; -- 2.39.5