summaryrefslogtreecommitdiff
path: root/plugins/FTPFileYM/src/dbentry.cpp
diff options
context:
space:
mode:
authorMataes <mataes2007@gmail.com>2018-03-17 22:36:40 +0300
committerMataes <mataes2007@gmail.com>2018-03-17 22:36:40 +0300
commit81781c336c74447c4d64b367b958b2c7835f7271 (patch)
treeefd90830d6e430e456cc3fd954b85bf21ac2d1e5 /plugins/FTPFileYM/src/dbentry.cpp
parent3ad5334f17119c9ae010d5059f5cfb1831c9ddbd (diff)
FTPFile: more correct version
Diffstat (limited to 'plugins/FTPFileYM/src/dbentry.cpp')
-rw-r--r--plugins/FTPFileYM/src/dbentry.cpp11
1 files changed, 4 insertions, 7 deletions
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;