Checks: '-*,
+ cppcoreguidelines-init-variables,
modernize-make-shared,
modernize-redundant-void-arg,
modernize-replace-*,
}
QDataStream ds(socket);
QByteArray uMsg;
- quint32 remaining;
+ quint32 remaining = 0;
ds >> remaining;
uMsg.resize(remaining);
int got = 0;
return;
}
- bool ok;
+ bool ok = false;
auto oldBlackListSet = journal->getSelectiveSyncList(SyncJournalDb::SelectiveSyncBlackList, &ok).toSet();
if (ok) {
if (!options.proxy.isNull()) {
QString host;
int port = 0;
- bool ok;
+ bool ok = false;
QStringList pList = options.proxy.split(':');
if (pList.count() == 3) {
* have at least 1/4 probability of changing.
* If _c_mix() is run forward, every bit of c will change between 1/3 and
* 2/3 of the time. (Well, 22/100 and 78/100 for some 2-bit deltas.)
- * _c_mix() was built out of 36 single-cycle latency instructions in a
+ * _c_mix() was built out of 36 single-cycle latency instructions in a
* structure that could supported 2x parallelism, like so:
* a -= b;
* a -= c; x = (c>>13);
* avalanche. About 36+6len instructions.
*/
static inline uint32_t c_jhash(const uint8_t *k, uint32_t length, uint32_t initval) {
- uint32_t a,b,c,len;
+ uint32_t a = 0;
+ uint32_t b = 0;
+ uint32_t c = 0;
+ uint32_t len = 0;
/* Set up the internal state */
len = length;
* achieves avalanche. About 41+5len instructions.
*/
static inline uint64_t c_jhash64(const uint8_t *k, uint64_t length, uint64_t intval) {
- uint64_t a,b,c,len;
+ uint64_t a = 0;
+ uint64_t b = 0;
+ uint64_t c = 0;
+ uint64_t len = 0;
/* Set up the internal state */
len = length;
QString *errorString)
{
#ifndef Q_OS_WIN
- bool success;
+ bool success = false;
QFile orig(originFileName);
// We want a rename that also overwites. QFile::rename does not overwite.
// Qt 5.1 has QSaveFile::renameOverwrite we could use.
unsigned int adler = adler32(0L, Z_NULL, 0);
if (file.open(QIODevice::ReadOnly)) {
- qint64 size;
+ qint64 size = 0;
while (!file.atEnd()) {
size = file.read(buf.data(), bufSize);
if (size > 0)
}
if (!_sql.isEmpty()) {
int n = 0;
- int rc;
+ int rc = 0;
do {
rc = sqlite3_prepare_v2(_db, _sql.constData(), -1, &_stmt, nullptr);
if ((rc == SQLITE_BUSY) || (rc == SQLITE_LOCKED)) {
// Don't do anything for selects, that is how we use the lib :-|
if (!isSelect() && !isPragma()) {
- int rc, n = 0;
+ int rc = 0, n = 0;
do {
rc = sqlite3_step(_stmt);
if (rc == SQLITE_LOCKED) {
qint64 SyncJournalDb::getPHash(const QByteArray &file)
{
- int64_t h;
+ int64_t h = 0;
if (file.isEmpty()) {
return -1;
void csync_memstat_check() {
int s = 0;
struct csync_memstat_s m;
- FILE* fp;
+ FILE* fp = nullptr;
/* get process memory stats */
fp = fopen("/proc/self/statm","r");
time_t oc_httpdate_parse( const char *date ) {
struct tm gmt;
char wkday[4], mon[4];
- int n;
+ int n = 0;
time_t result = 0;
memset(&gmt, 0, sizeof(struct tm));
}
char *c_strdup(const char *str) {
- char *ret;
+ char *ret = NULL;
ret = (char *) c_malloc(strlen(str) + 1);
if (ret == NULL) {
return NULL;
}
char *c_strndup(const char *str, size_t size) {
- char *ret;
- size_t len;
+ char *ret = NULL;
+ size_t len = 0;
len = strlen(str);
if (len > size) {
len = size;
if (state != AccountState::Connected) {
/* check if there are expanded root items, if so, close them */
- int i;
+ int i = 0;
for (i = 0; i < _model->rowCount(); ++i) {
if (_ui->_folderList->isExpanded(_model->index(i)))
_ui->_folderList->setExpanded(_model->index(i), false);
continue;
}
- bool ok;
+ bool ok = false;
auto undecidedList = folder->journalDb()->getSelectiveSyncList(SyncJournalDb::SelectiveSyncUndecidedList, &ok);
QString p;
foreach (const auto &it, undecidedList) {
// add new directories or remove gone away dirs to the watcher
if (_folderWatcher && item->isDirectory()) {
- switch (item->_instruction) {
- case CSYNC_INSTRUCTION_NEW:
+ switch (item->_instruction) {
+ case CSYNC_INSTRUCTION_NEW:
_folderWatcher->addPath(path() + item->_file);
- break;
- case CSYNC_INSTRUCTION_REMOVE:
+ break;
+ case CSYNC_INSTRUCTION_REMOVE:
_folderWatcher->removePath(path() + item->_file);
- break;
- case CSYNC_INSTRUCTION_RENAME:
+ break;
+ case CSYNC_INSTRUCTION_RENAME:
_folderWatcher->removePath(path() + item->_file);
_folderWatcher->addPath(path() + item->destination());
- break;
+ break;
default:
break;
- }
+ }
}
// Success and failure of sync items adjust what the next sync is
auto journal = journalDb();
// Add the entry to the blacklist if it is neither in the blacklist or whitelist already
- bool ok1, ok2;
+ bool ok1 = false;
+ bool ok2 = false;
auto blacklist = journal->getSelectiveSyncList(SyncJournalDb::SelectiveSyncBlackList, &ok1);
auto whitelist = journal->getSelectiveSyncList(SyncJournalDb::SelectiveSyncWhiteList, &ok2);
if (ok1 && ok2 && !blacklist.contains(newFolder) && !whitelist.contains(newFolder)) {
}
auto folder = _folders.at(i)._folder;
- bool ok;
+ bool ok = false;
auto oldBlackList = folder->journalDb()->getSelectiveSyncList(SyncJournalDb::SelectiveSyncBlackList, &ok);
if (!ok) {
qCWarning(lcFolderStatus) << "Could not read selective sync list from db.";
}
auto folder = _folders.at(i)._folder;
- bool ok;
+ bool ok = false;
auto undecidedList = folder->journalDb()->getSelectiveSyncList(SyncJournalDb::SelectiveSyncUndecidedList, &ok);
if (!ok) {
qCWarning(lcFolderStatus) << "Could not read selective sync list from db.";
void FolderWatcherPrivate::slotReceivedNotification(int fd)
{
- int len;
- struct inotify_event *event;
- int i;
- int error;
+ int len = 0;
+ struct inotify_event *event = nullptr;
+ int i = 0;
+ int error = 0;
QVarLengthArray<char, 2048> buffer(2048);
do {
/* Set the left contents margin of the layout to zero to make the checkboxes
* align properly vertically , fixes bug #3758
*/
- int m0, m1, m2, m3;
+ int m0 = 0;
+ int m1 = 0;
+ int m2 = 0;
+ int m3 = 0;
_ui->horizontalLayout_3->getContentsMargins(&m0, &m1, &m2, &m3);
_ui->horizontalLayout_3->setContentsMargins(0, m1, m2, m3);
void IgnoreListTableWidget::slotAddPattern()
{
- bool okClicked;
+ bool okClicked = false;
QString pattern = QInputDialog::getText(this, tr("Add Ignore Pattern"),
tr("Add a new ignore pattern:"),
QLineEdit::Normal, QString(), &okClicked);
while (!renameOk) {
renameOk = FolderMan::instance()->startFromScratch(localFolder);
if (!renameOk) {
- QMessageBox::StandardButton but;
- but = QMessageBox::question(nullptr, tr("Folder rename failed"),
+ QMessageBox::StandardButton but = QMessageBox::question(nullptr, tr("Folder rename failed"),
tr("Can't remove and back up the folder because the folder or a file in it is open in another program."
" Please close the folder or file and hit retry or cancel the setup."),
QMessageBox::Retry | QMessageBox::Abort, QMessageBox::Retry);
, _folder(folder)
, _okButton(nullptr) // defined in init()
{
- bool ok;
+ bool ok = false;
init(account);
QStringList selectiveSyncList = _folder->journalDb()->getSelectiveSyncList(SyncJournalDb::SelectiveSyncBlackList, &ok);
if (ok) {
auto *buttonBox = new QDialogButtonBox(Qt::Horizontal);
_okButton = buttonBox->addButton(QDialogButtonBox::Ok);
connect(_okButton, &QPushButton::clicked, this, &SelectiveSyncDialog::accept);
- QPushButton *button;
+ QPushButton *button = nullptr;
button = buttonBox->addButton(QDialogButtonBox::Cancel);
connect(button, &QAbstractButton::clicked, this, &QDialog::reject);
layout->addWidget(buttonBox);
void SelectiveSyncDialog::accept()
{
if (_folder) {
- bool ok;
+ bool ok = false;
auto oldBlackListSet = _folder->journalDb()->getSelectiveSyncList(SyncJournalDb::SelectiveSyncBlackList, &ok).toSet();
if (!ok) {
return;
auto height = _toolBar->sizeHint().height();
bool brandingSingleAccount = !Theme::instance()->multiAccount();
- QAction *accountAction;
+ QAction *accountAction = nullptr;
QImage avatar = s->account()->avatar();
const QString actionText = brandingSingleAccount ? tr("Account") : s->account()->displayName();
if (avatar.isNull()) {
void ShareDialog::slotLinkShareRequiresPassword()
{
- bool ok;
+ bool ok = false;
QString password = QInputDialog::getText(this,
tr("Password for share required"),
tr("Please enter a password for your link share:"),
}
void passwordRequired() {
- bool ok;
+ bool ok = false;
QString password = QInputDialog::getText(nullptr,
tr("Password for share required"),
tr("Please enter a password for your link share:"),
QString xml = QString::fromUtf8(reply->readAll());
- bool ok;
+ bool ok = false;
_updateInfo = UpdateInfo::parseString(xml, &ok);
if (ok) {
versionInfoArrived(_updateInfo);
}
QString errorMsg;
- int errorLine, errorCol;
+ int errorLine = 0, errorCol = 0;
QDomDocument doc;
if (!doc.setContent(&file, false, &errorMsg, &errorLine, &errorCol)) {
qCCritical(lcUpdater) << errorMsg << " at " << errorLine << "," << errorCol;
return UpdateInfo();
}
- bool documentOk;
+ bool documentOk = false;
UpdateInfo c = parseElement(doc.documentElement(), &documentOk);
if (ok) {
*ok = documentOk;
UpdateInfo UpdateInfo::parseString(const QString &xml, bool *ok)
{
QString errorMsg;
- int errorLine, errorCol;
+ int errorLine = 0, errorCol = 0;
QDomDocument doc;
if (!doc.setContent(xml, false, &errorMsg, &errorLine, &errorCol)) {
qCCritical(lcUpdater) << errorMsg << " at " << errorLine << "," << errorCol;
return UpdateInfo();
}
- bool documentOk;
+ bool documentOk = false;
UpdateInfo c = parseElement(doc.documentElement(), &documentOk);
if (ok) {
*ok = documentOk;
return res;
}
- QByteArray handleErrors(void)
+ QByteArray handleErrors()
{
Bio bioErrors;
ERR_print_errors(bioErrors); // This line is not printing anything.
QByteArray iv = generateRandom(12);
CipherCtx ctx;
+
/* Create and initialise the context */
if(!ctx) {
qCInfo(lcCse()) << "Error creating cipher";
}
QByteArray ptext(cipherTXT.size() + 16, '\0');
- int plen;
+ int plen = 0;
/* Provide the message to be decrypted, and obtain the plaintext output.
* EVP_DecryptUpdate can be called multiple times if necessary
}
QByteArray ptext(cipherTXT.size() + 16, '\0');
- int plen;
+ int plen = 0;
/* Provide the message to be decrypted, and obtain the plaintext output.
* EVP_DecryptUpdate can be called multiple times if necessary
QByteArray iv = generateRandom(16);
CipherCtx ctx;
+
/* Create and initialise the context */
if(!ctx) {
qCInfo(lcCse()) << "Error creating cipher";
{
list.clear();
- quint32 version;
+ quint32 version = 0;
stream >> version;
if (version != JAR_VERSION)
return stream;
- quint32 count;
+ quint32 count = 0;
stream >> count;
for (quint32 i = 0; i < count; ++i) {
QByteArray value;
bool PropagateRemoteMove::adjustSelectiveSync(SyncJournalDb *journal, const QString &from_, const QString &to_)
{
- bool ok;
+ bool ok = false;
// We only care about preserving the blacklist. The white list should anyway be empty.
// And the undecided list will be repopulated on the next sync, if there is anything too big.
QStringList list = journal->getSelectiveSyncList(SyncJournalDb::SelectiveSyncBlackList, &ok);
while (di.hasNext()) {
di.next();
const QFileInfo &fi = di.fileInfo();
- bool ok;
+ bool ok = false;
// The use of isSymLink here is okay:
// we never want to go into this branch for .lnk files
bool isDir = fi.isDir() && !fi.isSymLink() && !FileSystem::isJunction(fi.absoluteFilePath());
return shouldDiscoverLocally(path);
};
- bool ok;
+ bool ok = false;
auto selectiveSyncBlackList = _journal->getSelectiveSyncList(SyncJournalDb::SelectiveSyncBlackList, &ok);
if (ok) {
bool usingSelectiveSync = (!selectiveSyncBlackList.isEmpty());
*/
void SyncEngine::checkForPermission(SyncFileItemVector &syncItems)
{
- bool selectiveListOk;
+ bool selectiveListOk = false;
auto selectiveSyncBlackList = _journal->getSelectiveSyncList(SyncJournalDb::SelectiveSyncBlackList, &selectiveListOk);
std::sort(selectiveSyncBlackList.begin(), selectiveSyncBlackList.end());
SyncFileItemPtr needle;
public:
static int setup(void **state) {
- CSYNC *csync;
+ CSYNC *csync = nullptr;
csync = new CSYNC("/tmp/check_csync1", new OCC::SyncJournalDb(""));
excludedFiles = new ExcludedFiles;
}
static int setup_init(void **state) {
- CSYNC *csync;
+ CSYNC *csync = nullptr;
csync = new CSYNC("/tmp/check_csync1", new OCC::SyncJournalDb(""));
excludedFiles = new ExcludedFiles;
static int teardown(void **state) {
CSYNC *csync = (CSYNC*)*state;
- int rc;
+ int rc = 0;
auto statedb = csync->statedb;
delete csync;
#define FOO_DIR "/tmp/check_csync1/foo"
#define FOO_EXCLUDE_LIST FOO_DIR "/.sync-exclude.lst"
- int rc;
+ int rc = 0;
rc = system("mkdir -p " FOO_DIR);
assert_int_equal(rc, 0);
FILE *fh = fopen(FOO_EXCLUDE_LIST, "w");
0,
"4711");
- char *errmsg;
+ char *errmsg = nullptr;
rc = sqlite3_exec(db, stmt, NULL, NULL, &errmsg);
sqlite3_free(stmt);
assert_int_equal( rc, SQLITE_OK );
static int setup(void **state)
{
- CSYNC *csync;
- int rc;
+ CSYNC *csync = nullptr;
+ int rc = 0;
unlink(TESTDB);
rc = system("mkdir -p /tmp/check_csync");
assert_int_equal(rc, 0);
/* Create a new db with metadata */
- sqlite3 *db;
+ sqlite3 *db = nullptr;
rc = sqlite3_open(TESTDB, &db);
statedb_create_metadata_table(db);
if( firstrun ) {
static int setup_ftw(void **state)
{
- CSYNC *csync;
- int rc;
+ CSYNC *csync = nullptr;
+ int rc = 0;
rc = system("mkdir -p /tmp/check_csync");
assert_int_equal(rc, 0);
}
static int teardown_rm(void **state) {
- int rc;
+ int rc = 0;
teardown(state);
time_t mtime)
{
std::unique_ptr<csync_file_stat_t> fs(new csync_file_stat_t);
- time_t t;
+ time_t t = 0;
if (name && *name) {
fs->path = name;
static void check_csync_detect_update(void **state)
{
CSYNC *csync = (CSYNC*)*state;
- csync_file_stat_t *st;
+ csync_file_stat_t *st = nullptr;
std::unique_ptr<csync_file_stat_t> fs;
- int rc;
+ int rc = 0;
fs = create_fstat("file.txt", 0, 1217597845);
static void check_csync_detect_update_db_none(void **state)
{
CSYNC *csync = (CSYNC*)*state;
- csync_file_stat_t *st;
+ csync_file_stat_t *st = nullptr;
std::unique_ptr<csync_file_stat_t> fs;
- int rc;
+ int rc = 0;
fs = create_fstat("file.txt", 0, 1217597845);
static void check_csync_detect_update_db_eval(void **state)
{
CSYNC *csync = (CSYNC*)*state;
- csync_file_stat_t *st;
+ csync_file_stat_t *st = nullptr;
std::unique_ptr<csync_file_stat_t> fs;
- int rc;
+ int rc = 0;
fs = create_fstat("file.txt", 0, 42);
static void check_csync_detect_update_db_new(void **state)
{
CSYNC *csync = (CSYNC*)*state;
- csync_file_stat_t *st;
+ csync_file_stat_t *st = nullptr;
std::unique_ptr<csync_file_stat_t> fs;
- int rc;
+ int rc = 0;
fs = create_fstat("file.txt", 42000, 0);
static void check_csync_ftw(void **state)
{
CSYNC *csync = (CSYNC*)*state;
- int rc;
+ int rc = 0;
rc = csync_ftw(csync, "/tmp", csync_walker, MAX_DEPTH);
assert_int_equal(rc, 0);
static void check_csync_ftw_empty_uri(void **state)
{
CSYNC *csync = (CSYNC*)*state;
- int rc;
+ int rc = 0;
rc = csync_ftw(csync, "", csync_walker, MAX_DEPTH);
assert_int_equal(rc, -1);
static void check_csync_ftw_failing_fn(void **state)
{
CSYNC *csync = (CSYNC*)*state;
- int rc;
+ int rc = 0;
rc = csync_ftw(csync, "/tmp", failing_fn, MAX_DEPTH);
assert_int_equal(rc, -1);
static void check_csync_instruction_str(void **state)
{
- const char *str;
+ const char *str = nullptr;
(void) state; /* unused */
static void check_c_malloc_zero(void **state)
{
- void *p;
+ void *p = NULL;
(void) state; /* unused */
static void check_c_jhash_trials(void **state)
{
uint8_t qa[MAXLEN+1], qb[MAXLEN+2], *a = &qa[0], *b = &qb[1];
- uint32_t c[HASHSTATE], d[HASHSTATE], i, j=0, k, l, m, z;
+ uint32_t c[HASHSTATE];
+ uint32_t d[HASHSTATE];
+ uint32_t i = 0;
+ uint32_t j = 0;
+ uint32_t k = 0;
+ uint32_t l = 0;
+ uint32_t m = 0;
+ uint32_t z = 0;
uint32_t e[HASHSTATE],f[HASHSTATE],g[HASHSTATE],h[HASHSTATE];
uint32_t x[HASHSTATE],y[HASHSTATE];
- uint32_t hlen;
+ uint32_t hlen = 0;
(void) state; /* unused */
static void check_c_jhash_alignment_problems(void **state)
{
- uint32_t test;
- uint8_t buf[MAXLEN+20], *b;
- uint32_t len;
+ uint32_t test = 0;
+ uint8_t buf[MAXLEN+20];
+ uint8_t *b = NULL;
+ uint32_t len = 0;
uint8_t q[] = "This is the time for all good men to come to the aid of their country";
uint8_t qq[] = "xThis is the time for all good men to come to the aid of their country";
uint8_t qqq[] = "xxThis is the time for all good men to come to the aid of their country";
uint8_t qqqq[] = "xxxThis is the time for all good men to come to the aid of their country";
- uint32_t h,i,j,ref,x,y;
+ uint32_t h = 0;
+ uint32_t i = 0;
+ uint32_t j = 0;
+ uint32_t ref = 0;
+ uint32_t x = 0;
+ uint32_t y = 0;
(void) state; /* unused */
static void check_c_jhash_null_strings(void **state)
{
uint8_t buf[1];
- uint32_t h, i, t;
+ uint32_t h = 0;
+ uint32_t i = 0;
+ uint32_t t = 0;
(void) state; /* unused */
static void check_c_jhash64_trials(void **state)
{
uint8_t qa[MAXLEN + 1], qb[MAXLEN + 2];
- uint8_t *a, *b;
- uint64_t c[HASHSTATE], d[HASHSTATE], i, j=0, k, l, m, z;
- uint64_t e[HASHSTATE],f[HASHSTATE],g[HASHSTATE],h[HASHSTATE];
- uint64_t x[HASHSTATE],y[HASHSTATE];
- uint64_t hlen;
+ uint8_t *a = NULL, *b = NULL;
+ uint64_t c[HASHSTATE];
+ uint64_t d[HASHSTATE];
+ uint64_t i = 0;
+ uint64_t j=0;
+ uint64_t k = 0;
+ uint64_t l = 0;
+ uint64_t m = 0;
+ uint64_t z = 0;
+ uint64_t e[HASHSTATE];
+ uint64_t f[HASHSTATE];
+ uint64_t g[HASHSTATE];
+ uint64_t h[HASHSTATE];
+ uint64_t x[HASHSTATE];
+ uint64_t y[HASHSTATE];
+ uint64_t hlen = 0;
(void) state; /* unused */
static void check_c_jhash64_alignment_problems(void **state)
{
- uint8_t buf[MAXLEN+20], *b;
- uint64_t len;
+ uint8_t buf[MAXLEN+20];
+ uint8_t *b = NULL;
+ uint64_t len = 0;
uint8_t q[] = "This is the time for all good men to come to the aid of their country";
uint8_t qq[] = "xThis is the time for all good men to come to the aid of their country";
uint8_t qqq[] = "xxThis is the time for all good men to come to the aid of their country";
uint8_t oo[] = "xxxxxThis is the time for all good men to come to the aid of their country";
uint8_t ooo[] = "xxxxxxThis is the time for all good men to come to the aid of their country";
uint8_t oooo[] = "xxxxxxxThis is the time for all good men to come to the aid of their country";
- uint64_t h,i,j,ref,t,x,y;
+ uint64_t h = 0;
+ uint64_t i = 0;
+ uint64_t j = 0;
+ uint64_t ref = 0;
+ uint64_t t = 0;
+ uint64_t x = 0;
+ uint64_t y = 0;
(void) state; /* unused */
static void check_c_jhash64_null_strings(void **state)
{
uint8_t buf[1];
- uint64_t h, i, t;
+ uint64_t h = 0;
+ uint64_t i = 0;
+ uint64_t t = 0;
(void) state; /* unused */
static int setup(void **state)
{
- CSYNC *csync;
- int rc;
+ CSYNC *csync = nullptr;
+ int rc = 0;
assert_non_null(getcwd(wd_buffer, WD_BUFFER_SIZE));
}
static int setup_dir(void **state) {
- int rc;
+ int rc = 0;
mbchar_t *dir = c_utf8_path_to_locale(CSYNC_TEST_DIR);
setup(state);
static int teardown(void **state) {
CSYNC *csync = (CSYNC*)*state;
- int rc;
+ int rc = 0;
auto statedb = csync->statedb;
delete csync;
static void check_csync_vio_opendir(void **state)
{
CSYNC *csync = (CSYNC*)*state;
- csync_vio_handle_t *dh;
- int rc;
+ csync_vio_handle_t *dh = nullptr;
+ int rc = 0;
dh = csync_vio_opendir(csync, CSYNC_TEST_DIR);
assert_non_null(dh);
static void check_csync_vio_opendir_perm(void **state)
{
CSYNC *csync = (CSYNC*)*state;
- csync_vio_handle_t *dh;
- int rc;
+ csync_vio_handle_t *dh = nullptr;
+ int rc = 0;
mbchar_t *dir = c_utf8_path_to_locale(CSYNC_TEST_DIR);
assert_non_null(dir);
static void check_csync_vio_closedir_null(void **state)
{
CSYNC *csync = (CSYNC*)*state;
- int rc;
+ int rc = 0;
rc = csync_vio_closedir(csync, NULL);
assert_int_equal(rc, -1);
}
static int setup_testenv(void **state) {
- int rc;
+ int rc = 0;
rc = wipe_testdir();
assert_int_equal(rc, 0);
static int teardown(void **state) {
statevar *sv = (statevar*) *state;
CSYNC *csync = sv->csync;
- int rc;
+ int rc = 0;
output("================== Tearing down!\n");
*/
static void create_dirs( const char *path )
{
- int rc;
+ int rc = 0;
char *mypath = (char*)c_malloc( 2+strlen(CSYNC_TEST_DIR)+strlen(path));
*mypath = '\0';
strcat(mypath, CSYNC_TEST_DIR);
*/
static void traverse_dir(void **state, const char *dir, int *cnt)
{
- csync_vio_handle_t *dh;
+ csync_vio_handle_t *dh = nullptr;
std::unique_ptr<csync_file_stat_t> dirent;
statevar *sv = (statevar*) *state;
CSYNC *csync = sv->csync;
- char *subdir;
- char *subdir_out;
- int rc;
- int is_dir;
+ char *subdir = nullptr;
+ char *subdir_out = nullptr;
+ int rc = 0;
+ int is_dir = 0;
/* Format: Smuggle in the C: for unix platforms as its urgently needed
* on Windows and the test can be nicely cross platform this way. */
strcpy(filepath, path);
strcat(filepath, name);
- FILE *sink;
+ FILE *sink = nullptr;
sink = fopen(filepath,"w");
fprintf (sink, "we got: %s",content);