--- Spectre2/Share.cpp 2005/03/27 06:35:26 431 +++ Spectre2/Share.cpp 2005/04/07 22:56:53 439 @@ -94,10 +94,21 @@ extern "C" void authenticate(const char* host, const char* name, char* work, int workSize, char* owner, int ownerSize, char* password, int passwordSize) { const Share& share(*Daemon::shares.Find(Share(host, name))); + const ext::Buffer& owner_(share.getOwner().GetData()); - if (!share.getOwner().IsEmpty()) - ::snprintf(owner, ownerSize, "%s", share.getOwner().NullTerminate()); + if (!owner_.IsEmpty()) + { + _foreach (const ext::Buffer, atom, owner_) + owner[_index] = *atom; + + owner[owner_.GetSize() < size_t(ownerSize) ? owner_.GetSize() : ownerSize - 1] = '\0'; + } - ::snprintf(password, passwordSize, "%s", share.getPassword().NullTerminate()); + ext::Buffer password_(share.getPassword().GetData()); + + _foreach (ext::Buffer, atom, password_) + password[_index] = *atom; + + password[password_.GetSize() < size_t(passwordSize) ? password_.GetSize() : passwordSize - 1] = '\0'; } }