From b687e00b9b6da96a440dd9622cdec16fe3bb3330 Mon Sep 17 00:00:00 2001 From: Calvin Tee Date: Fri, 19 Dec 2014 21:43:26 +0800 Subject: [PATCH] use the old string replace for to fix #15 --- utils.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils.h b/utils.h index a12566a..996dcb4 100644 --- a/utils.h +++ b/utils.h @@ -87,8 +87,8 @@ vector make_array(string data) { */ void string_replacer(string &source, const string find, const string replace) { size_t j = 0; - for (j = source.find(find, j); j != string::npos; ) { - source.replace(j, find.length(), replace); + for ( ; (j = source.find(find,j)) != string::npos ; ) { + source.replace( j, find.length(), replace ); j = j + replace.length(); } }