s = strzone(s);
lleft = l;
- for (i = 0;i < strlen(s);++i)
+ int len = strlen(s);
+ for (i = 0; i < len; ++i)
{
if (substring(s, i, 2) == "\\n")
{
if (lleft > 0)
{
callback(" ");
- lleft = lleft - 1;
+ --lleft;
}
}
else
{
- for (j = i+1;j < strlen(s);++j)
+ for (j = i+1; j < len; ++j)
// ^^ this skips over the first character of a word, which
// is ALWAYS part of the word
// this is safe since if i+1 == strlen(s), i will become
lleft = l;
}
callback(substring(s, i, wlen));
- lleft = lleft - wlen;
+ lleft -= wlen;
i = j - 1;
}
}
return r;
}
+ERASEABLE
+void write_String_To_File(int fh, string str, bool alsoprint)
+{
+ fputs(fh, str);
+ if (alsoprint) LOG_INFO(str);
+}
+
string get_model_datafilename(string m, float sk, string fil)
{
if(m)