Hello,

str_trim does not work as expected for "strange strings", such as a string filled with only white spaces or a string starting with any number of spaces followed by just a single character. Here's some test code that works without assets:

Code:
#include "strio.c"

void main() {
	STRING* test_str;
	
	//Check empty string + 1 char (does not work)
	test_str=str_create("   .");
	diag("\n\"");
	diag(test_str);
	diag("\" -> \"");
	str_trim(test_str);
	diag(test_str);
	diag("\"\n\n");
	
	//Check empty string + 2 chars (works)
	str_cpy(test_str,"    ..");	
	diag("\n\"");
	diag(test_str);
	diag("\" -> \"");
	str_trim(test_str);
	diag(test_str);
	diag("\"\n\n");

	//Check empty string (does not work)
	str_cpy(test_str,"      ");	
	diag("\n\"");
	diag(test_str);
	diag("\" -> \"");
	str_trim(test_str);
	diag(test_str);
	diag("\"\n\n");


	sys_exit(NULL);	
}



Relevant part of the acklog.txt output:

Code:
"   ." -> "   ."


"    .." -> ".."


"      " -> "      "




Not a big deal, granted, but noteworthy nonetheless. Looking at strio.c, it also doesn't seem like a very hard thing to fix.

Best wishes!


Perhaps this post will get me points for originality at least.

Check out Dungeon Deities! It's amazing and will make you happy, successful and almost certainly more attractive! It might be true!