From d3346ec4ab71b3555320e691d983e9baeee36e02 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 5 Jul 2007 18:37:43 +0000 Subject: [PATCH] Use portable fgets instead of getline. --- src/icu_chain_test.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/icu_chain_test.c b/src/icu_chain_test.c index 6c630ae..aed6af2 100644 --- a/src/icu_chain_test.c +++ b/src/icu_chain_test.c @@ -415,9 +415,8 @@ static void print_info(const struct config_t *p_config) static void process_text_file(const struct config_t *p_config) { - char * line = 0; - size_t line_cap = 0; - ssize_t line_len; + char *line = 0; + char linebuf[1024]; xmlDoc *doc = xmlParseFile(config.conffile); xmlNode *xml_node = xmlDocGetRootElement(doc); @@ -441,7 +440,8 @@ static void process_text_file(const struct config_t *p_config) "\n"); // read input lines for processing - while ((line_len = getline(&line, &line_cap, config.infile)) != -1) { + while ((line=fgets(linebuf, sizeof(linebuf)-1, config.infile))) + { success = icu_chain_assign_cstr(config.chain, line, &status); line_count++; -- 1.7.10.4