From 81781c336c74447c4d64b367b958b2c7835f7271 Mon Sep 17 00:00:00 2001 From: Mataes Date: Sat, 17 Mar 2018 22:36:40 +0300 Subject: FTPFile: more correct version --- plugins/FTPFileYM/src/dbentry.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'plugins/FTPFileYM/src/dbentry.cpp') diff --git a/plugins/FTPFileYM/src/dbentry.cpp b/plugins/FTPFileYM/src/dbentry.cpp index 492666db45..f5c5684327 100644 --- a/plugins/FTPFileYM/src/dbentry.cpp +++ b/plugins/FTPFileYM/src/dbentry.cpp @@ -43,13 +43,12 @@ DBEntry *DBEntry::getNext(DBEntry *entry) { char szValue[256]; int count = db_get_dw(0, MODULE_FILES, "NextFileID", 0); - + + CMStringA frmt; for (; entryID < count; entryID++) { int ftpNum = DB::getByteF(0, MODULE_FILES, "Ftp%d", entryID, -1); if (ftpNum != -1) { - CMStringA frmt; - frmt.Format("Filename%d", entryID); - ptrA Value(db_get_sa(NULL, MODULE, frmt)); + ptrA Value(db_get_sa(NULL, MODULE, frmt.Format("Filename%d", entryID))); if (Value) { strncpy_s(szValue, Value, _TRUNCATE); entry->m_fileID = entryID; @@ -91,9 +90,7 @@ DBEntry* DBEntry::get(int fileID) int ftpNum = DB::getByteF(0, MODULE_FILES, "Ftp%d", fileID, -1); if (ftpNum != -1) { - CMStringA frmt; - frmt.Format("Filename%d", fileID); - ptrA Value(db_get_sa(NULL, MODULE, frmt)); + ptrA Value(db_get_sa(NULL, MODULE, CMStringA(FORMAT, "Filename%d", fileID))); if (Value) { strncpy_s(szValue, Value, _TRUNCATE); entry->m_fileID = fileID; -- cgit v1.2.3