fixed seg fault on nzb-names starting with msgid

This commit is contained in:
Andrey Prygunkov
2007-11-29 18:53:17 +00:00
parent b66266cf82
commit 1b80cdd9b4
2 changed files with 22 additions and 22 deletions

View File

@@ -255,9 +255,7 @@ bool RemoteClient::RequestServerList()
char* szFilename = pBufPtr + sizeof(SNZBListRequestAnswerEntry) + pListAnswer->m_iNZBFilenameLen + pListAnswer->m_iSubjectLen;
char szNZBNiceName[1024];
strncpy(szNZBNiceName, BaseFileName(szNZBFilename), 1024);
szNZBNiceName[1024-1] = '\0';
if (char* p = strrchr(szNZBNiceName, '.')) *p = '\0';
FileInfo::MakeNiceNZBName(szNZBFilename, szNZBNiceName, 1024);
printf("[%i] %s%c%s (%.2f MB%s)%s\n", pListAnswer->m_iID, szNZBNiceName, (int)PATH_SEPARATOR, szFilename, pListAnswer->m_iFileSize / 1024.0 / 1024.0, szCompleted, szStatus);