diff --git a/cocos/2d/CCFont.cpp b/cocos/2d/CCFont.cpp index 1561df741f..11da370314 100644 --- a/cocos/2d/CCFont.cpp +++ b/cocos/2d/CCFont.cpp @@ -75,12 +75,12 @@ void Font::setCurrentGlyphCollection(GlyphCollection glyphs, const char *customG default: if (customGlyphs) { - size_t lenght = strlen(customGlyphs); - _customGlyphs = new char [lenght + 2]; - memcpy(_customGlyphs, customGlyphs, lenght); + size_t length = strlen(customGlyphs); + _customGlyphs = new char [length + 2]; + memcpy(_customGlyphs, customGlyphs, length); - _customGlyphs[lenght] = 0; - _customGlyphs[lenght+1] = 0; + _customGlyphs[length] = 0; + _customGlyphs[length+1] = 0; } break;