summaryrefslogtreecommitdiff
path: root/src/client/GameSave.cpp
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-12-09 00:14:48 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-12-09 00:14:48 (GMT)
commit05148e8a8db3a413edb711108fd860d3ee83154f (patch)
treedd14ac13354b581580570a91a990ba80f672d19d /src/client/GameSave.cpp
parent226de5b6f88c95a4f76675be067de1af5de13902 (diff)
downloadpowder-05148e8a8db3a413edb711108fd860d3ee83154f.zip
powder-05148e8a8db3a413edb711108fd860d3ee83154f.tar.gz
C++erific text cleaner function, also, it's a good idea to actually clean text coming from signs...
Diffstat (limited to 'src/client/GameSave.cpp')
-rw-r--r--src/client/GameSave.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/client/GameSave.cpp b/src/client/GameSave.cpp
index a4d654f..2dabcd3 100644
--- a/src/client/GameSave.cpp
+++ b/src/client/GameSave.cpp
@@ -4,6 +4,7 @@
#include <vector>
#include <bzlib.h>
#include "Config.h"
+#include "Format.h"
#include "bson/BSON.h"
#include "GameSave.h"
#include "simulation/SimulationData.h"
@@ -501,12 +502,7 @@ void GameSave::readOPS(char * data, int dataLength)
{
if(strcmp(bson_iterator_key(&signiter), "text")==0 && bson_iterator_type(&signiter)==BSON_STRING)
{
- char tempString[256];
- strncpy(tempString, bson_iterator_string(&signiter), 255);
- tempString[255] = 0;
- clean_text((char*)tempSign.text.c_str(), 158-14);
-
- tempSign.text = tempString;
+ tempSign.text = format::CleanString(bson_iterator_string(&signiter), 255);
}
else if(strcmp(bson_iterator_key(&signiter), "justification")==0 && bson_iterator_type(&signiter)==BSON_INT)
{