replace sprintf with snprintf

This commit is contained in:
LinWenhai 2014-07-22 22:05:56 +08:00
parent f38b48914f
commit 815d063a0a
1 changed files with 1 additions and 1 deletions

View File

@ -179,7 +179,7 @@ FontAtlas * FontAtlasCache::getFontAtlasCharMap(Texture2D* texture, int itemWidt
FontAtlas * FontAtlasCache::getFontAtlasCharMap(const std::string& charMapFile, int itemWidth, int itemHeight, int startCharMap)
{
char tmp[255];
sprintf(tmp,"name:%s_%d_%d_%d",charMapFile.c_str(),itemWidth,itemHeight,startCharMap);
snprintf(tmp,200,"name:%s_%d_%d_%d",charMapFile.c_str(),itemWidth,itemHeight,startCharMap);
std::string atlasName = generateFontName(tmp, 0, GlyphCollection::CUSTOM,false);