NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->nonce, r->nonce_len));
NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, &r->sid));
/* We articially increment the offset of 20 bytes (size of hash
- * comming after the pad) so that ndr_align can determine easily
+ * coming after the pad) so that ndr_align can determine easily
* the correct pad size to make the whole struct 8 bytes aligned
*/
ofs = ndr->offset + 20;
NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->nonce, r->nonce_len));
NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, &r->sid));
/* We articially increment the offset of 64 bytes (size of hash
- * comming after the pad) so that ndr_align can determine easily
+ * coming after the pad) so that ndr_align can determine easily
* the correct pad size to make the whole struct 16 bytes aligned
*/
ofs = ndr->offset + 64;
z->total_out = 0;
if (!z->opaque) {
- /* the first time we need to intialize completely */
+ /* the first time we need to initialize completely */
z->zalloc = ndr_zlib_alloc;
z->zfree = ndr_zlib_free;
z->opaque = ndrpull;
}
}
- /* call inflate untill we get Z_STREAM_END or an error */
+ /* call inflate until we get Z_STREAM_END or an error */
while (true) {
z_ret = inflate(z, Z_BLOCK);
if (z_ret != Z_OK) break;
z->total_out = 0;
if (!z->opaque) {
- /* the first time we need to intialize completely */
+ /* the first time we need to initialize completely */
z->zalloc = ndr_zlib_alloc;
z->zfree = ndr_zlib_free;
z->opaque = ndrpull;
}
}
- /* call deflate untill we get Z_STREAM_END or an error */
+ /* call deflate until we get Z_STREAM_END or an error */
while (true) {
z_ret = deflate(z, Z_FINISH);
if (z_ret != Z_OK) break;
}
if (z_ret != Z_STREAM_END) {
return ndr_push_error(ndrpush, NDR_ERR_COMPRESSION,
- "Bad delate(Z_BLOCK) error %s(%d) (PUSH)",
+ "Bad deflate(Z_BLOCK) error %s(%d) (PUSH)",
zError(z_ret), z_ret);
}
-/*
+/*
Unix SMB/CIFS implementation.
routines for marshalling/unmarshalling string types
Copyright (C) Andrew Tridgell 2003
-
+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
case LIBNDR_FLAG_STR_NULLTERM:
/*
* We ensure that conv_str_len cannot return 0 by
- * requring that there be enough bytes for at least
+ * requiring that there be enough bytes for at least
* the NULL terminator
*/
if (byte_mul == 1) {
if (NDR_BE(ndr)) {
chset = CH_UTF16BE;
}
-
+
s_len = s?strlen(s):0;
if (flags & LIBNDR_FLAG_STR_ASCII) {
} else if (!convert_string_talloc(ndr, CH_UNIX, chset, s, s_len,
(void **)(void *)&dest, &d_len))
{
- return ndr_push_error(ndr, NDR_ERR_CHARCNV,
+ return ndr_push_error(ndr, NDR_ERR_CHARCNV,
"Bad character push conversion with flags 0x%x", flags);
}
default:
if (ndr->flags & LIBNDR_FLAG_REMAINING) {
NDR_CHECK(ndr_push_bytes(ndr, dest, d_len));
- break;
+ break;
}
return ndr_push_error(ndr, NDR_ERR_STRING, "Bad string flags 0x%x\n",
}
}
-_PUBLIC_ uint32_t ndr_size_string(int ret, const char * const* string, int flags)
+_PUBLIC_ uint32_t ndr_size_string(int ret, const char * const* string, int flags)
{
/* FIXME: Is this correct for all strings ? */
if(!(*string)) return ret;
* but separated by a null terminator
*
* which means the same as:
- * Every string is null terminated exept the last
+ * Every string is null terminated except the last
* string is terminated by the end of the buffer
*
* as LIBNDR_FLAG_STR_NULLTERM also end at the end
return ndr_push_error(ndr, NDR_ERR_STRING, "Bad string flags 0x%x\n",
ndr->flags & LIBNDR_STRING_FLAGS);
}
-
+
ndr->flags = saved_flags;
return NDR_ERR_SUCCESS;
}
}
/**
- * Return number of elements in a string including the last (zeroed) element
+ * Return number of elements in a string including the last (zeroed) element
*/
_PUBLIC_ uint32_t ndr_string_length(const void *_var, uint32_t element_size)
{
discard_const_p(void *, var),
&converted_size))
{
- return ndr_pull_error(ndr, NDR_ERR_CHARCNV,
+ return ndr_pull_error(ndr, NDR_ERR_CHARCNV,
"Bad character conversion");
}
NDR_CHECK(ndr_pull_advance(ndr, length*byte_mul));
return ndr_push_error(ndr, NDR_ERR_LENGTH, "length overflow");
}
required = byte_mul * length;
-
+
NDR_PUSH_NEED_BYTES(ndr, required);
if (required) {
if (!convert_string(CH_UNIX, chset,
var, strlen(var),
ndr->data+ndr->offset, required, &size)) {
- return ndr_push_error(ndr, NDR_ERR_CHARCNV,
+ return ndr_push_error(ndr, NDR_ERR_CHARCNV,
"Bad character conversion");
}