Index: cpp/frams/util/sstring-simple.cpp
===================================================================
--- cpp/frams/util/sstring-simple.cpp	(revision 970)
+++ cpp/frams/util/sstring-simple.cpp	(revision 973)
@@ -8,5 +8,5 @@
 void SString::initEmpty()
 {
-	txt = NULL; used = 0; size = 0;
+	txt = NULL; used = 0; allocated = 0;
 }
 
@@ -18,5 +18,5 @@
 SString::~SString()
 {
-	resize(0);
+	reallocate(0);
 }
 
@@ -36,6 +36,6 @@
 SString::SString(SString&& from)
 {
-	txt = from.txt; size = from.size; used = from.used;
-	from.txt = NULL; from.size = 0; from.used = 0;
+	txt = from.txt; allocated = from.allocated; used = from.used;
+	from.txt = NULL; from.allocated = 0; from.used = 0;
 }
 
@@ -46,20 +46,20 @@
 }
 
-void SString::resize(int newsize)
-{
-	if (newsize == size) return;
+void SString::reallocate(int newsize)
+{
+	if (newsize == allocated) return;
 	txt = (char*)realloc(txt, newsize);
-	size = newsize;
-}
-
-void SString::ensureSize(int needed)
-{
-	if (size > needed) return;
-	resize((size > 0) ? (needed + needed / 2 + 1) : (needed + 1));
+	allocated = newsize;
+}
+
+void SString::ensureAllocated(int needed)
+{
+	if (allocated > needed) return;
+	reallocate((allocated > 0) ? (needed + needed / 2 + 1) : (needed + 1));
 }
 
 char *SString::directWrite(int ensuresize)
 {
-	ensureSize(ensuresize);
+	ensureAllocated(ensuresize);
 	appending = used;
 	return txt;
@@ -68,5 +68,5 @@
 char *SString::directAppend(int maxappend)
 {
-	ensureSize(used + maxappend);
+	ensureAllocated(used + maxappend);
 	appending = used;
 	return txt + appending;
@@ -78,5 +78,5 @@
 	else txt[newlength] = 0;
 	used = newlength;
-	assert(used < size);
+	assert(used < allocated);
 }
 
@@ -86,5 +86,5 @@
 	else txt[appending + newappend] = 0;
 	used = appending + newappend;
-	assert(used < size);
+	assert(used < allocated);
 }
 
@@ -102,5 +102,5 @@
 {
 	if (!n) return;
-	ensureSize(used + n);
+	ensureAllocated(used + n);
 	memmove(txt + used, t, n);
 	used += n;
@@ -110,5 +110,5 @@
 void SString::operator+=(const SString&s)
 {
-	append(s.c_str(), s.len());
+	append(s.c_str(), s.length());
 }
 
@@ -116,5 +116,5 @@
 {
 	SString ret;
-	ret.reserve(len() + s.len());
+	ret.reserve(length() + s.length());
 	ret = *this;
 	ret += s;
@@ -130,5 +130,5 @@
 	if (chlen)
 	{
-		ensureSize(chlen);
+		ensureAllocated(chlen);
 		memmove(txt, ch, chlen);
 		txt[chlen] = 0;
@@ -153,16 +153,16 @@
 {
 	if (&s == this) return;
-	copyFrom(s.c_str(), s.len());
+	copyFrom(s.c_str(), s.length());
 }
 
 ///////////////////////////////////////
 
-SString SString::substr(int begin, int length) const
-{
-	if (begin < 0) { length += begin; begin = 0; }
-	if (length >= (len() - begin)) length = len() - begin;
-	if (length <= 0) return SString();
-	if (length == len()) return *this;
-	return SString((*this)(begin), length);
+SString SString::substr(int begin, int numchars) const
+{
+	if (begin < 0) { numchars += begin; begin = 0; }
+	if (numchars >= (length() - begin)) numchars = length() - begin;
+	if (numchars <= 0) return SString();
+	if (numchars == length()) return *this;
+	return SString((*this)(begin), numchars);
 }
 
@@ -172,5 +172,5 @@
 {
 	if (this == &s) return true;
-	if (len() != s.len()) return false;
+	if (length() != s.length()) return false;
 	return strcmp(getPtr(), s.getPtr()) == 0;
 }
@@ -198,9 +198,9 @@
 bool SString::getNextToken(int& pos, SString &token, char separator) const
 {
-	if (pos >= len()) { token = 0; return false; }
+	if (pos >= length()) { token = 0; return false; }
 	int p1 = pos, p2;
 	const char *t1 = getPtr() + pos;
 	const char *t2 = strchr(t1, separator);
-	if (t2) pos = (p2 = (t2 - getPtr())) + 1; else p2 = pos = len();
+	if (t2) pos = (p2 = (t2 - getPtr())) + 1; else p2 = pos = length();
 	strncpy(token.directWrite(p2 - p1), t1, p2 - p1);
 	token.endWrite(p2 - p1);
@@ -254,5 +254,5 @@
 		char* p = ret.directWrite(size);
 		assert(p != NULL);
-		size = ret.directMaxLen() + 1;
+		size = ret.capacity() + 1;
 		/* Try to print in the allocated space. */
 		va_start(ap, format);
