summaryrefslogtreecommitdiff
path: root/plugins/Dbx_mmap_SA/Import_SA
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-06-02 20:55:18 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-06-02 20:55:18 +0000
commit78c0815c4118fe24ab78cce2dc48a6232dcd824a (patch)
tree8512c50df70b8dd80c919e88ade3419207c95956 /plugins/Dbx_mmap_SA/Import_SA
parentce816d83a8c75808e0eb06832592bffefe4a8dc4 (diff)
- code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@270 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Dbx_mmap_SA/Import_SA')
-rw-r--r--plugins/Dbx_mmap_SA/Import_SA/encryption.c12
-rw-r--r--plugins/Dbx_mmap_SA/Import_SA/mirabilis.c34
-rw-r--r--plugins/Dbx_mmap_SA/Import_SA/miranda.c4
-rw-r--r--plugins/Dbx_mmap_SA/Import_SA/mirandahistory.c4
4 files changed, 27 insertions, 27 deletions
diff --git a/plugins/Dbx_mmap_SA/Import_SA/encryption.c b/plugins/Dbx_mmap_SA/Import_SA/encryption.c
index 6cb98d20c1..f261581041 100644
--- a/plugins/Dbx_mmap_SA/Import_SA/encryption.c
+++ b/plugins/Dbx_mmap_SA/Import_SA/encryption.c
@@ -62,7 +62,7 @@ void InitSecurity()
GetModuleFileName(NULL,szMirandaDir,SIZEOF(szMirandaDir));
str2 = _tcsrchr(szMirandaDir,'\\');
- if( str2 != NULL )
+ if ( str2 != NULL )
*str2=0;
_tchdir(szMirandaDir);
}
@@ -112,7 +112,7 @@ void InitSecurity()
}
}
if(ModulesCount >= 100) break;
- if(!FindNextFileA(hFile, &fd)) break;
+ if (!FindNextFileA(hFile, &fd)) break;
}
AddMessage(LPGEN("%d crypto modules loaded"), ModulesCount);
@@ -173,14 +173,14 @@ int CheckPassword(WORD checkWord, WORD cryptorUID, TCHAR * szDBName)
{
int i;
int Found = 0;
- for(i = 0; i < ModulesCount; i++){
+ for(i = 0; i < ModulesCount; i++) {
if(cryptorUID == Modules[i]->cryptor->uid){
CryptoEngine = Modules[i]->cryptor;
Found = 1;
break;
}
}
- if(!Found){
+ if (!Found){
AddMessage(LPGEN("Sorry, but your database encrypted with unknown module"), MB_OK);
bCheckingPass = 0;
return 0;
@@ -245,7 +245,7 @@ BOOL CALLBACK DlgStdInProc(HWND hDlg, UINT uMsg,WPARAM wParam,LPARAM lParam)
hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_PASS));
SendMessage(GetDlgItem(hDlg, IDC_HEADERBAR), WM_SETICON, 0, (LPARAM)hIcon);
- if(!wrongPass)
+ if (!wrongPass)
{
mir_sntprintf(tszHeaderTxt, SIZEOF(tszHeaderTxt), _T("%s\n%s"), TranslateT("Please type in your password for"), lParam);
SetWindowText(GetDlgItem(hDlg, IDC_HEADERBAR), tszHeaderTxt);
@@ -287,7 +287,7 @@ BOOL CALLBACK DlgStdInProc(HWND hDlg, UINT uMsg,WPARAM wParam,LPARAM lParam)
UINT uid = LOWORD(wParam);
if(uid == IDOK){
- if(!GetWindowLongPtr(hDlg,GWLP_USERDATA))
+ if (!GetWindowLongPtr(hDlg,GWLP_USERDATA))
{
encryptKeyLength = GetDlgItemTextA(hDlg, IDC_USERPASS, encryptKey, 254);
EndDialog(hDlg,IDOK);
diff --git a/plugins/Dbx_mmap_SA/Import_SA/mirabilis.c b/plugins/Dbx_mmap_SA/Import_SA/mirabilis.c
index 6d99757d4d..130843205e 100644
--- a/plugins/Dbx_mmap_SA/Import_SA/mirabilis.c
+++ b/plugins/Dbx_mmap_SA/Import_SA/mirabilis.c
@@ -244,7 +244,7 @@ static int GetHighestIndexEntry(void)
DWORD ofs;
ofs=*(PDWORD)(pIdx+12);
- for(;;) {
+ for (;;) {
entry=(struct TIdxIndexEntry*)(pIdx+ofs);
if(entry->entryIdLow==(DWORD)-2) return ((struct TIdxDatEntry*)entry)->entryId;
if(entry->ofsHigher>=0xF0000000) ofs=entry->ofsInHere;
@@ -256,7 +256,7 @@ static int GetIdDatOfs(DWORD id)
{
struct TIdxIndexEntry *entry;
DWORD ofs = *(PDWORD)(pIdx+12);
- for(;;) {
+ for (;;) {
entry=(struct TIdxIndexEntry*)(pIdx+ofs);
if(entry->entryIdLow==(DWORD)-2) {
if(entry->entryIdHigh==id) return ((struct TIdxDatEntry*)entry)->datOfs;
@@ -389,7 +389,7 @@ DWORD ReadPropertyBlock(DWORD dwOffset, char* SearchWord, int* nSearchResult)
if ( SearchWord ) {
// Is this the property we are searching for?
- if(!lstrcmpA((char*)(pDat+nameOfs),SearchWord)){
+ if (!lstrcmpA((char*)(pDat+nameOfs),SearchWord)) {
*nSearchResult = 1;
return dwOffset;
} }
@@ -485,10 +485,10 @@ DWORD FindMyDetails(void)
DWORD dwOffset = GetIdDatOfs(1005);
if (!dwOffset) return 0;
- if(*(PDWORD)(pDat+dwOffset+0x08) != 1005) return 0;
- if(*(PBYTE)(pDat+dwOffset+0x0C) != 0xE4) return 0;
- if(*(int*)(pDat+dwOffset+0x1e) != 'USER') return 0;
- if(*(PDWORD)(pDat+dwOffset+0x22) != 6) return 0;
+ if (*(PDWORD)(pDat+dwOffset+0x08) != 1005) return 0;
+ if (*(PBYTE)(pDat+dwOffset+0x0C) != 0xE4) return 0;
+ if (*(int*)(pDat+dwOffset+0x1e) != 'USER') return 0;
+ if (*(PDWORD)(pDat+dwOffset+0x22) != 6) return 0;
return dwOffset;
}
@@ -527,7 +527,7 @@ DWORD FindGroupList(DWORD dwOffset)
dwOffset += 0x04; // ++ UNKNOWN ++
dwPhoneEntries = *(PDWORD)(pDat+dwOffset); // Phonebook starts here
dwOffset += 0x04;
- for(n = 0;n<dwPhoneEntries;n++){
+ for(n = 0;n<dwPhoneEntries;n++) {
dwOffset += *(PWORD)(pDat+dwOffset)+2;
dwOffset += *(PWORD)(pDat+dwOffset)+2;
dwOffset += *(PWORD)(pDat+dwOffset)+2;
@@ -597,7 +597,7 @@ DWORD FindGroupList(DWORD dwOffset)
dwOffset += 0x08;
dwPhoneEntries = *(PDWORD)(pDat+dwOffset); // Phonebook
dwOffset += 0x04;
- for(n = 0;n<dwPhoneEntries;n++){
+ for(n = 0;n<dwPhoneEntries;n++) {
dwOffset += *(PWORD)(pDat+dwOffset)+2;
dwOffset += *(PWORD)(pDat+dwOffset)+2;
dwOffset += *(PWORD)(pDat+dwOffset)+2;
@@ -649,8 +649,8 @@ char* GetGroupName(DWORD dwGroupID)
switch (dwDBVersion) {
case DBV99A:
case DBV99B:
- for (n = 0; n < dwGroups; n++){
- if (dwGroupID == *(PDWORD)(pDat + dwOffset)){
+ for (n = 0; n < dwGroups; n++) {
+ if (dwGroupID == *(PDWORD)(pDat + dwOffset)) {
if (*(PWORD)(pDat + dwOffset + 4) > 1)
return 6 + (char*)(pDat + dwOffset);
@@ -665,10 +665,10 @@ char* GetGroupName(DWORD dwGroupID)
case DBV2000A:
case DBV2000B:
case DBV2001A:
- for (n = 0; n < dwGroups; n++){
- if (tmpOfs = ReadPropertyBlock(dwOffset, "GroupID", &nSearchResult)){
+ for (n = 0; n < dwGroups; n++) {
+ if (tmpOfs = ReadPropertyBlock(dwOffset, "GroupID", &nSearchResult)) {
if (nSearchResult) {
- if (dwGroupID == *(PDWORD)(pDat + tmpOfs + 1)){
+ if (dwGroupID == *(PDWORD)(pDat + tmpOfs + 1)) {
strGroupName = 3 + (char*)(pDat + ReadPropertyBlock(dwOffset, "GroupName", &nSearchResult));
if (nSearchResult) {
if ((DWORD)*(strGroupName - 2) > 1)
@@ -745,7 +745,7 @@ int ImportGroups()
switch (nFormat) {
case ENTRYV99A:
case ENTRYV99B:
- for (n = 0; n < dwGroups; n++){
+ for (n = 0; n < dwGroups; n++) {
if (*(PWORD)(pDat+dwOffset+4) > 1) {
if ( CreateGroup(DBVT_ASCIIZ, (char*)(pDat + dwOffset) + 6, NULL ))
nImported++;
@@ -758,8 +758,8 @@ int ImportGroups()
case ENTRYV2001A:
case ENTRYV2001B:
case ENTRYV2002A:
- for (n = 0; n < dwGroups; n++){
- if (tmpOfs = ReadPropertyBlock(dwOffset, "GroupName", &nSearchResult)){
+ for (n = 0; n < dwGroups; n++) {
+ if (tmpOfs = ReadPropertyBlock(dwOffset, "GroupName", &nSearchResult)) {
if (nSearchResult) {
if (CreateGroup( DBVT_ASCIIZ, (char*)(pDat + tmpOfs + 3), NULL ))
nImported++;
diff --git a/plugins/Dbx_mmap_SA/Import_SA/miranda.c b/plugins/Dbx_mmap_SA/Import_SA/miranda.c
index 6812557533..69b348d192 100644
--- a/plugins/Dbx_mmap_SA/Import_SA/miranda.c
+++ b/plugins/Dbx_mmap_SA/Import_SA/miranda.c
@@ -517,7 +517,7 @@ int CheckFileFormat(HANDLE hDbFile)
bEncrypted = FALSE;
if (memcmp(pdbHeader->signature, &dbSignature, sizeof(pdbHeader->signature))) {
// Unsane: if not encrypted signature
- if (memcmp(pdbHeader->signature, &dbSignatureEncrypted, sizeof(pdbHeader->signature))){
+ if (memcmp(pdbHeader->signature, &dbSignatureEncrypted, sizeof(pdbHeader->signature))) {
AddMessage( LPGEN("Signature mismatch" ));
return DB_INVALID;
}
@@ -525,7 +525,7 @@ int CheckFileFormat(HANDLE hDbFile)
// Unsane: check password
InitSecurity();
tszDbName = _tcsrchr(importFile, _T('\\')) + 1;
- if (CheckPassword(pdbHeader->checkWord, pdbHeader->cryptorUID, tszDbName)){
+ if (CheckPassword(pdbHeader->checkWord, pdbHeader->cryptorUID, tszDbName)) {
AddMessage(LPGEN("Secured MMAP: authorization successful"));
bEncrypted = TRUE;
}
diff --git a/plugins/Dbx_mmap_SA/Import_SA/mirandahistory.c b/plugins/Dbx_mmap_SA/Import_SA/mirandahistory.c
index 232d295f8d..ba7a923df7 100644
--- a/plugins/Dbx_mmap_SA/Import_SA/mirandahistory.c
+++ b/plugins/Dbx_mmap_SA/Import_SA/mirandahistory.c
@@ -92,7 +92,7 @@ static PBYTE ReadHistoryLines(FILE *fp,int *cbBlob)
blob=(char*)realloc(blob,*cbBlob+1);
lstrcpy(blob+ofs,str);
}
- if(*cbBlob) {
+ if (*cbBlob) {
(*cbBlob)--;
blob[*cbBlob-1]=0;
}
@@ -150,7 +150,7 @@ static void OldMirandaHistoryImport(HWND hdlgProgress)
tmEventTime.tm_mon=atoi(timeofs+10)-1;
tmEventTime.tm_year=atoi(timeofs+13)-1900;
dbei.timestamp=mktime(&tmEventTime)+_timezone;
- if(!(importOptions&historyTypeToOption[type])) continue;
+ if (!(importOptions&historyTypeToOption[type])) continue;
hContact=HistoryImportFindContact(hdlgProgress,uin,importOptions&IOPT_ADDUNKNOWN);
if(hContact==INVALID_HANDLE_VALUE) break;
dbei.flags=issent(type)?DBEF_SENT:DBEF_READ;