init class members in Url

This commit is contained in:
Brian Rasmusson
2016-09-30 14:23:18 +02:00
parent 7a0ac67861
commit 765b7094cc
2 changed files with 14 additions and 3 deletions

13
Url.cpp

@ -19,6 +19,11 @@
#include <valgrind/memcheck.h>
#endif
Url::Url() {
reset();
}
void Url::reset() {
m_scheme = NULL;
m_host = NULL;
@ -41,6 +46,14 @@ void Url::reset() {
m_anchorLen = 0;
// ip related stuff
m_ip = 0;
// Coverity
m_plen = 0;
m_flen = 0;
m_tldLen = 0;
m_port = 0;
m_defPort = 0;
m_portLen = 0;
}
void Url::set( const Url *baseUrl, const char *s, int32_t len, bool addWWW, bool stripParams, bool stripPound,

4
Url.h

@ -48,9 +48,7 @@ int32_t getPathDepth ( char *s , bool hasHttp );
class Url {
public:
Url() {
reset();
}
Url();
// set from another Url, does a copy
void set( const Url *url ) {