]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/tools/gendict/gendict.cpp
ICU-62107.0.1.tar.gz
[apple/icu.git] / icuSources / tools / gendict / gendict.cpp
index 73b9fec32b8f2f2aeb0b5bc0a2acaa5715dc53bf..b712640091e5817b932dce3d87a293675486d066 100644 (file)
@@ -314,7 +314,7 @@ int  main(int argc, char **argv) {
     //  Read in the dictionary source file
     if (verbose) { printf("Opening file %s...\n", wordFileName); }
     const char *codepage = "UTF-8";
-    UCHARBUF *f = ucbuf_open(wordFileName, &codepage, TRUE, FALSE, status);
+    LocalUCHARBUFPointer f(ucbuf_open(wordFileName, &codepage, TRUE, FALSE, status));
     if (status.isFailure()) {
         fprintf(stderr, "error opening input file: ICU Error \"%s\"\n", status.errorName());
         exit(status.reset());
@@ -338,10 +338,10 @@ int  main(int argc, char **argv) {
     int minlen = 255;
     int maxlen = 0;
     UBool isOk = TRUE;
-    while (readLine(f, fileLine, status)) {
+    while (readLine(f.getAlias(), fileLine, status)) {
         lineCount++;
         if (fileLine.isEmpty()) continue;
-        
         // Parse word [spaces value].
         int32_t keyLen;
         for (keyLen = 0; keyLen < fileLine.length() && !u_isspace(fileLine[keyLen]); ++keyLen) {}