From: Howard Chu Date: Fri, 26 Jul 2002 03:22:53 +0000 (+0000) Subject: Minor uniformity tweaks, use lutil_progname, don't use fscanf X-Git-Tag: NO_SLAP_OP_BLOCKS~1333 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=84b91f70adbdbb4f3300c3917cbc3916aaf256aa;p=openldap Minor uniformity tweaks, use lutil_progname, don't use fscanf --- 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;