Skip to content
Low-level programming · Higher-level thinking
Login Register
Forum / Bugs and Fixes

Possible problem with strLen

A community discussion post from the original code:zIRON forum.

Molotov member
Posts
49
Threads
21
Location
Behind Keyboard

Possible problem with strLen

Application crashes "just disappeares" when running this code, used wait_key(nil) to see where it crashes, and when i put it after strLen() it never gets triggered :)

	uses edi esi ecx ebx;
	char curVar[90], server_name[30], server_ip[20], server_port[20], server_type[20], server_password[30];
	char* servers;
	servers = new 2048;
	
	pointer zFile;
	zFile = fileopen(serverfile,OPEN_EXISTING);
	if(zFile == null) {
		print('Couldn´t open file \r\n');

		return false;
	} else {
		print('file_open\r\n');

	}
	fileread(zFile,servers,2048,null);
	
	fileclose(zFile);
	
	
	esi = servers;
	ecx = strLen(esi);
	wait_key(nil);

"Lerning new things is what life is all about, if you are always doing the same old things day in and day out you might aswell just kill yourself." - ME d^_^b

Replies

Colin admin
Posts
928
Threads
49
Location
Bulgaria

Seems there is a small problem with my fixup code, i will fix it now, as a quick fix so u can continue working just add this line below your uses clause:

char fix[128];

like so:

uses edi esi ecx ebx;
  char fix[128];
  char curVar[90], server_name[30], server_ip[20], server_port[20], server_type[20], server_password[30];
  char* servers;
  servers = new 2048;
Molotov member
Posts
49
Threads
21
Location
Behind Keyboard

Ah ok.. thanks :)

this means i can continue working on the application tommorrow 8)

"Lerning new things is what life is all about, if you are always doing the same old things day in and day out you might aswell just kill yourself." - ME d^_^b

Colin admin
Posts
928
Threads
49
Location
Bulgaria

just to note that i have fixed this for next beta release