mirror of
https://github.com/pocoproject/poco.git
synced 2025-04-26 18:11:29 +02:00
fixed some warnings and minor issues detected by clang-analyzer
Conflicts: Data/src/RecordSet.cpp
This commit is contained in:
parent
fbbf197fd2
commit
ae3c4a4ba3
@ -256,8 +256,7 @@ bool RecordSet::moveFirst()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::size_t currentRow = _currentRow;
|
std::size_t currentRow = 0;
|
||||||
currentRow = 0;
|
|
||||||
while (!isAllowed(currentRow))
|
while (!isAllowed(currentRow))
|
||||||
{
|
{
|
||||||
if (currentRow >= rc - 1) return false;
|
if (currentRow >= rc - 1) return false;
|
||||||
@ -303,8 +302,7 @@ bool RecordSet::moveLast()
|
|||||||
{
|
{
|
||||||
if (storageRowCount() > 0)
|
if (storageRowCount() > 0)
|
||||||
{
|
{
|
||||||
std::size_t currentRow = _currentRow;
|
std::size_t currentRow = subTotalRowCount() - 1;
|
||||||
currentRow = storageRowCount() - 1;
|
|
||||||
if (!isFiltered())
|
if (!isFiltered())
|
||||||
{
|
{
|
||||||
_currentRow = currentRow;
|
_currentRow = currentRow;
|
||||||
|
@ -119,7 +119,7 @@ Poco::UInt64 StreamCopier::copyToString64(std::istream& istr, std::string& str,
|
|||||||
|
|
||||||
std::streamsize StreamCopier::copyStreamUnbuffered(std::istream& istr, std::ostream& ostr)
|
std::streamsize StreamCopier::copyStreamUnbuffered(std::istream& istr, std::ostream& ostr)
|
||||||
{
|
{
|
||||||
char c;
|
char c = 0;
|
||||||
std::streamsize len = 0;
|
std::streamsize len = 0;
|
||||||
istr.get(c);
|
istr.get(c);
|
||||||
while (istr && ostr)
|
while (istr && ostr)
|
||||||
@ -135,7 +135,7 @@ std::streamsize StreamCopier::copyStreamUnbuffered(std::istream& istr, std::ostr
|
|||||||
#if defined(POCO_HAVE_INT64)
|
#if defined(POCO_HAVE_INT64)
|
||||||
Poco::UInt64 StreamCopier::copyStreamUnbuffered64(std::istream& istr, std::ostream& ostr)
|
Poco::UInt64 StreamCopier::copyStreamUnbuffered64(std::istream& istr, std::ostream& ostr)
|
||||||
{
|
{
|
||||||
char c;
|
char c = 0;
|
||||||
Poco::UInt64 len = 0;
|
Poco::UInt64 len = 0;
|
||||||
istr.get(c);
|
istr.get(c);
|
||||||
while (istr && ostr)
|
while (istr && ostr)
|
||||||
|
@ -242,6 +242,7 @@ void HTTPResponse::read(std::istream& istr)
|
|||||||
while (ch != '\r' && ch != '\n' && ch != eof && reason.length() < MAX_REASON_LENGTH) { reason += (char) ch; ch = istr.get(); }
|
while (ch != '\r' && ch != '\n' && ch != eof && reason.length() < MAX_REASON_LENGTH) { reason += (char) ch; ch = istr.get(); }
|
||||||
if (!Poco::Ascii::isSpace(ch)) throw MessageException("HTTP reason string too long");
|
if (!Poco::Ascii::isSpace(ch)) throw MessageException("HTTP reason string too long");
|
||||||
if (ch == '\r') ch = istr.get();
|
if (ch == '\r') ch = istr.get();
|
||||||
|
if (ch != '\n') throw MessageException("Unterminated HTTP response line");
|
||||||
|
|
||||||
HTTPMessage::read(istr);
|
HTTPMessage::read(istr);
|
||||||
ch = istr.get();
|
ch = istr.get();
|
||||||
|
@ -105,18 +105,21 @@ namespace
|
|||||||
poco_check_ptr (pPS);
|
poco_check_ptr (pPS);
|
||||||
NameValueCollection::ConstIterator it = header.begin();
|
NameValueCollection::ConstIterator it = header.begin();
|
||||||
NameValueCollection::ConstIterator end = header.end();
|
NameValueCollection::ConstIterator end = header.end();
|
||||||
|
bool added = false;
|
||||||
for (; it != end; ++it)
|
for (; it != end; ++it)
|
||||||
{
|
{
|
||||||
if (MailMessage::HEADER_CONTENT_DISPOSITION == it->first)
|
if (!added && MailMessage::HEADER_CONTENT_DISPOSITION == it->first)
|
||||||
{
|
{
|
||||||
if (it->second == "inline")
|
if (it->second == "inline")
|
||||||
_pMsg->addContent(pPS, cte);
|
_pMsg->addContent(pPS, cte);
|
||||||
else
|
else
|
||||||
_pMsg->addAttachment("", pPS, cte);
|
_pMsg->addAttachment("", pPS, cte);
|
||||||
|
added = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
pPS->headers().set(it->first, it->second);
|
pPS->headers().set(it->first, it->second);
|
||||||
}
|
}
|
||||||
|
if (!added) delete pPS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,13 +88,13 @@ int MultipartStreamBuf::readFromDevice(char* buffer, std::streamsize length)
|
|||||||
{
|
{
|
||||||
if (ch == '\r')
|
if (ch == '\r')
|
||||||
{
|
{
|
||||||
ch = buf.sbumpc(); // '\n'
|
buf.sbumpc(); // '\n'
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else if (ch == '-' && buf.sgetc() == '-')
|
else if (ch == '-' && buf.sgetc() == '-')
|
||||||
{
|
{
|
||||||
ch = buf.sbumpc(); // '-'
|
buf.sbumpc(); // '-'
|
||||||
_lastPart = true;
|
_lastPart = true;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -268,7 +268,7 @@ void MultipartReader::guessBoundary()
|
|||||||
ch = _istr.peek();
|
ch = _istr.peek();
|
||||||
}
|
}
|
||||||
if (ch == '\r' || ch == '\n')
|
if (ch == '\r' || ch == '\n')
|
||||||
ch = _istr.get();
|
_istr.get();
|
||||||
if (_istr.peek() == '\n')
|
if (_istr.peek() == '\n')
|
||||||
_istr.get();
|
_istr.get();
|
||||||
}
|
}
|
||||||
@ -281,7 +281,7 @@ void MultipartReader::parseHeader(MessageHeader& messageHeader)
|
|||||||
messageHeader.clear();
|
messageHeader.clear();
|
||||||
messageHeader.read(_istr);
|
messageHeader.read(_istr);
|
||||||
int ch = _istr.get();
|
int ch = _istr.get();
|
||||||
if (ch == '\r' && _istr.peek() == '\n') ch = _istr.get();
|
if (ch == '\r' && _istr.peek() == '\n') _istr.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ int QuotedPrintableDecoderBuf::readFromDevice()
|
|||||||
ch = _buf.sbumpc();
|
ch = _buf.sbumpc();
|
||||||
if (ch == '\r')
|
if (ch == '\r')
|
||||||
{
|
{
|
||||||
ch = _buf.sbumpc(); // read \n
|
_buf.sbumpc(); // read \n
|
||||||
}
|
}
|
||||||
else if (Poco::Ascii::isHexDigit(ch))
|
else if (Poco::Ascii::isHexDigit(ch))
|
||||||
{
|
{
|
||||||
|
@ -43,7 +43,7 @@ void ConsoleCertificateHandler::onInvalidCertificate(const void*, VerificationEr
|
|||||||
std::cout << "The certificate yielded the error: " << errorCert.errorMessage() << "\n\n";
|
std::cout << "The certificate yielded the error: " << errorCert.errorMessage() << "\n\n";
|
||||||
std::cout << "The error occurred in the certificate chain at position " << errorCert.errorDepth() << "\n";
|
std::cout << "The error occurred in the certificate chain at position " << errorCert.errorDepth() << "\n";
|
||||||
std::cout << "Accept the certificate (y,n)? ";
|
std::cout << "Accept the certificate (y,n)? ";
|
||||||
char c;
|
char c = 0;
|
||||||
std::cin >> c;
|
std::cin >> c;
|
||||||
if (c == 'y' || c == 'Y')
|
if (c == 'y' || c == 'Y')
|
||||||
errorCert.setIgnoreError(true);
|
errorCert.setIgnoreError(true);
|
||||||
|
@ -267,7 +267,7 @@ void PageReader::nextToken(std::istream& istr, std::string& token)
|
|||||||
if (ch == '<' && istr.peek() == '%')
|
if (ch == '<' && istr.peek() == '%')
|
||||||
{
|
{
|
||||||
token += "<%";
|
token += "<%";
|
||||||
ch = istr.get();
|
istr.get();
|
||||||
ch = istr.peek();
|
ch = istr.peek();
|
||||||
switch (ch)
|
switch (ch)
|
||||||
{
|
{
|
||||||
@ -300,7 +300,7 @@ void PageReader::nextToken(std::istream& istr, std::string& token)
|
|||||||
else if (ch == '%' && istr.peek() == '>')
|
else if (ch == '%' && istr.peek() == '>')
|
||||||
{
|
{
|
||||||
token += "%>";
|
token += "%>";
|
||||||
ch = istr.get();
|
istr.get();
|
||||||
}
|
}
|
||||||
else token += (char) ch;
|
else token += (char) ch;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user