Fix SEGV bugs on Solaris

Revealed by 'rhizomeprotocol' tests FileTransferDelete, DirectPush and
DirectSync.
This commit is contained in:
Andrew Bettison 2012-10-05 15:49:36 +09:30
parent 063fe6d467
commit b4c92a289e
2 changed files with 2 additions and 2 deletions

View File

@ -248,7 +248,7 @@ int rhizome_manifest_check_file(rhizome_manifest *m_in)
}
}
if (debug & DEBUG_RHIZOME)
DEBUGF("filename=%s, fileLength=%lld", m_in->dataFileName ? alloca_str_toprint(m_in->dataFileName) : NULL, m_in->fileLength);
DEBUGF("filename=%s, fileLength=%lld", m_in->dataFileName ? alloca_str_toprint(m_in->dataFileName) : "NULL", m_in->fileLength);
if (mfilesize != -1 && mfilesize != m_in->fileLength) {
WHYF("Manifest.filesize (%lld) != actual file size (%lld)", mfilesize, m_in->fileLength);
return -1;

View File

@ -971,7 +971,7 @@ void rhizome_direct_http_dispatch(rhizome_direct_sync_request *r)
long long rowid = -1;
sqlite3_blob *blob=NULL;
sqlite_exec_int64(&rowid, "select rowid from files where id='%s';", hash);
DEBUGF("Reading from rowid #%d filehash='%s'",rowid,hash?hash:"(null)");
DEBUGF("Reading from rowid #%lld filehash='%s'",rowid,hash?hash:"(null)");
if (rowid >= 0 && sqlite3_blob_open(rhizome_db, "main", "files", "data",
rowid, 0, &blob) != SQLITE_OK)
goto closeit;