]> granicus.if.org Git - icu/commitdiff
ICU-13356 gennorm2 crashes if the input file contains blank lines.
authorJeff Genovy <29107334+jefgen@users.noreply.github.com>
Thu, 14 Sep 2017 19:04:20 +0000 (19:04 +0000)
committerJeff Genovy <29107334+jefgen@users.noreply.github.com>
Thu, 14 Sep 2017 19:04:20 +0000 (19:04 +0000)
X-SVN-Rev: 40414

icu4c/source/tools/gennorm2/gennorm2.cpp

index c0815c4e577df0e466e02444fca742c0f0987435..2d24d61071ba8135bace7879ee324044e5c3292d 100644 (file)
@@ -235,6 +235,9 @@ void parseFile(std::ifstream &f, Normalizer2DataBuilder &builder) {
     std::string lineString;
     uint32_t startCP, endCP;
     while(std::getline(f, lineString)) {
+        if (lineString.empty()) {
+            continue;  // skip empty lines.
+        }
 #if (U_CPLUSPLUS_VERSION >= 11)
         char *line = &lineString.front();
 #else