]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crush/CrushCompiler.cc:884 10952/head
authorxu biao <xubiao.codeyz@gmail.com>
Wed, 7 Sep 2016 00:04:07 +0000 (08:04 +0800)
committerxu biao <xubiao.codeyz@gmail.com>
Wed, 7 Sep 2016 00:04:07 +0000 (08:04 +0800)
bug fix: index out of range

Signed-off-by: xu biao <xubiao.codeyz@gmail.com>
src/crush/CrushCompiler.cc

index 1ce72fbbcbdc7d9776dc541d7049c15de8b34ab8..73d9f23d3561069113fb2d68ef828f7d1dfda781 100644 (file)
@@ -881,7 +881,7 @@ int CrushCompiler::compile(istream& in, const char *infn)
   while (getline(in, str)) {
     // remove newline
     int l = str.length();
-    if (l && str[l] == '\n')
+    if (l && str[l - 1] == '\n')
       str.erase(l-1, 1);
 
     line_val[line] = str;