From: xu biao Date: Wed, 7 Sep 2016 00:04:07 +0000 (+0800) Subject: crush/CrushCompiler.cc:884 X-Git-Tag: v11.0.1~267^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a46a18fe560445ad4bc7c4353f30324fb676db0f;p=ceph.git crush/CrushCompiler.cc:884 bug fix: index out of range Signed-off-by: xu biao --- diff --git a/src/crush/CrushCompiler.cc b/src/crush/CrushCompiler.cc index 1ce72fbbcbdc..73d9f23d3561 100644 --- a/src/crush/CrushCompiler.cc +++ b/src/crush/CrushCompiler.cc @@ -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;