CMM: fix strchr in WebView and Liza

git-svn-id: svn://kolibrios.org@5625 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2015-07-29 20:06:46 +00:00
parent 155cf5487f
commit 17a7b0eed7
4 changed files with 10 additions and 11 deletions

View File

@ -113,10 +113,10 @@ void LinksArray::GetAbsoluteURL(dword in_URL){
IF (!strcmpn(in_URL,"./", 2)) in_URL+=2; IF (!strcmpn(in_URL,"./", 2)) in_URL+=2;
strcpy(#newurl, BrowserHistory.CurrentUrl()); strcpy(#newurl, BrowserHistory.CurrentUrl());
if (ESBYTE[in_URL] == '/') if (ESBYTE[in_URL] == '/') //remove everything after site domain name
{ {
i = strchr(#newurl+8, '/'); i = strchr(#newurl+8, '/');
if (i>0) newurl[i+7]=0; if (i) ESBYTE[i]=0;
in_URL+=1; in_URL+=1;
} }

View File

@ -400,7 +400,7 @@ inline fastcall void chrcat(ESI, BL)
} }
/*inline fastcall signed int strchr( ESI,BL) inline fastcall signed int old_strchr( ESI,BL)
{ {
int jj=0; int jj=0;
do{ do{
@ -409,7 +409,7 @@ inline fastcall void chrcat(ESI, BL)
IF(AL==BL) return jj; IF(AL==BL) return jj;
} while(AL!=0); } while(AL!=0);
return 0; return 0;
}*/ }
inline dword strchr(dword shb;char s) inline dword strchr(dword shb;char s)
{ {
@ -919,7 +919,6 @@ inline void debugi(dword d_int)
} }
//#define strncpy strcpyn
#define strnmov strmovn #define strnmov strmovn
#define stricmp strcmpi #define stricmp strcmpi
#define strcmpn strncmp #define strcmpn strncmp

View File

@ -136,9 +136,9 @@ void OpenMailDat() {
} }
else else
{ {
strcpy(#pass_b64, #read_data+strchr(#read_data, '\n')+1); strcpy(#pass_b64, strchr(#read_data, '\n'));
base64_decode stdcall (#pass_b64, #pass_text, strlen(#pass_b64)); base64_decode stdcall (#pass_b64, #pass_text, strlen(#pass_b64));
read_data[strchr(#read_data, '\n')-1] = NULL; ESBYTE[strchr(#read_data, '\n')] = NULL;
strcpy(#email_text, #read_data); strcpy(#email_text, #read_data);
} }
pass_box.size = pass_box.pos = strlen(#pass_text); pass_box.size = pass_box.pos = strlen(#pass_text);

View File

@ -209,13 +209,13 @@ void DrawLoginScreen()
void GetSettings() void GetSettings()
{ {
int at_pos = strchr(#email_text,'@'); strcpy(#login, #email_text);
strlcpy(#login, #email_text, at_pos-1); ESBYTE[strchr(#login,'@')] = NULL;
if (checked[CUSTOM]) if (checked[CUSTOM])
{ {
strcpy(#POP_server_path, "pop."); strcpy(#POP_server_path, "pop.");
strcat(#POP_server_path, #email_text+at_pos); strcat(#POP_server_path, strchr(#email_text,'@')+1);
POP_server_port = DEFAULT_POP_PORT; POP_server_port = DEFAULT_POP_PORT;
} }
if (checked[MANUAL]) if (checked[MANUAL])