94 |
|
void authenticate(const char* host, const char* name, char* work, int workSize, char* owner, int ownerSize, char* password, int passwordSize) |
95 |
|
{ |
96 |
|
const Share& share(*Daemon::shares.Find(Share(host, name))); |
97 |
+ |
const ext::Buffer& owner_(share.getOwner().GetData()); |
98 |
|
|
99 |
< |
if (!share.getOwner().IsEmpty()) |
100 |
< |
::snprintf(owner, ownerSize, "%s", share.getOwner().NullTerminate()); |
99 |
> |
if (!owner_.IsEmpty()) |
100 |
> |
{ |
101 |
> |
_foreach (const ext::Buffer, atom, owner_) |
102 |
> |
owner[_index] = *atom; |
103 |
> |
|
104 |
> |
owner[owner_.GetSize() < size_t(ownerSize) ? owner_.GetSize() : ownerSize - 1] = '\0'; |
105 |
> |
} |
106 |
|
|
107 |
< |
::snprintf(password, passwordSize, "%s", share.getPassword().NullTerminate()); |
107 |
> |
ext::Buffer password_(share.getPassword().GetData()); |
108 |
> |
|
109 |
> |
_foreach (ext::Buffer, atom, password_) |
110 |
> |
password[_index] = *atom; |
111 |
> |
|
112 |
> |
password[password_.GetSize() < size_t(passwordSize) ? password_.GetSize() : passwordSize - 1] = '\0'; |
113 |
|
} |
114 |
|
} |