From: Danny Al-Gaaf Date: Tue, 14 May 2013 18:13:54 +0000 (+0200) Subject: src/os/FlatIndex.cc: reduce scope of suffix_len X-Git-Tag: v0.64~119^2~18 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2c60bc1ea6693379375df35b472de12753f7bd26;p=ceph.git src/os/FlatIndex.cc: reduce scope of suffix_len Signed-off-by: Danny Al-Gaaf --- diff --git a/src/os/FlatIndex.cc b/src/os/FlatIndex.cc index f2e071340604..f4a5ce3ab7dc 100644 --- a/src/os/FlatIndex.cc +++ b/src/os/FlatIndex.cc @@ -99,9 +99,8 @@ static void build_filename(char *filename, int len, const char *old_filename, in hash_filename(old_filename, hash, sizeof(hash)); int ofs = FILENAME_PREFIX_LEN; - int suffix_len; while (1) { - suffix_len = sprintf(filename + ofs, "_%s_%d_" FILENAME_COOKIE, hash, i); + int suffix_len = sprintf(filename + ofs, "_%s_%d_" FILENAME_COOKIE, hash, i); if (ofs + suffix_len <= FILENAME_SHORT_LEN || !ofs) break; ofs--;