diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2008-10-13 15:33:40 +0200 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2008-10-13 15:33:40 +0200 |
commit | 6d02f0805a001ae4ac19219c7fff5247e470b0fd (patch) | |
tree | 8ba49eff2209b6dda2c1a5a560141dc8ef287588 | |
parent | 58f844ab5422490d49b21701ffbe706c06b8c40a (diff) | |
download | samba-6d02f0805a001ae4ac19219c7fff5247e470b0fd.tar.gz samba-6d02f0805a001ae4ac19219c7fff5247e470b0fd.tar.bz2 samba-6d02f0805a001ae4ac19219c7fff5247e470b0fd.zip |
Import warning fixes from Samba 3 into libndr, sync more libndr code.
-rw-r--r-- | source3/librpc/ndr/libndr.h | 1 | ||||
-rw-r--r-- | source3/librpc/ndr/ndr_string.c | 20 | ||||
-rw-r--r-- | source4/librpc/ndr/ndr_string.c | 3 |
3 files changed, 12 insertions, 12 deletions
diff --git a/source3/librpc/ndr/libndr.h b/source3/librpc/ndr/libndr.h index 64e8e4c44c..a860f35998 100644 --- a/source3/librpc/ndr/libndr.h +++ b/source3/librpc/ndr/libndr.h @@ -420,6 +420,7 @@ uint32_t ndr_pull_get_switch_value(struct ndr_pull *ndr, const void *p); uint32_t ndr_print_get_switch_value(struct ndr_print *ndr, const void *p); enum ndr_err_code ndr_pull_struct_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, void *p, ndr_pull_flags_fn_t fn); enum ndr_err_code ndr_pull_struct_blob_all(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, void *p, ndr_pull_flags_fn_t fn); +enum ndr_err_code ndr_pull_union_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, void *p, uint32_t level, ndr_pull_flags_fn_t fn); enum ndr_err_code ndr_pull_union_blob_all(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, void *p, uint32_t level, ndr_pull_flags_fn_t fn); /* from libndr_basic.h */ diff --git a/source3/librpc/ndr/ndr_string.c b/source3/librpc/ndr/ndr_string.c index a2ee8723b1..86d7b26586 100644 --- a/source3/librpc/ndr/ndr_string.c +++ b/source3/librpc/ndr/ndr_string.c @@ -89,7 +89,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_string(struct ndr_pull *ndr, int ndr_flags, &converted_size, false)) { return ndr_pull_error(ndr, NDR_ERR_CHARCNV, - "Bad char conversion"); + "Bad character conversion"); } } NDR_CHECK(ndr_pull_advance(ndr, (len2 + c_len_term)*byte_mul)); @@ -127,7 +127,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_string(struct ndr_pull *ndr, int ndr_flags, &converted_size, false)) { return ndr_pull_error(ndr, NDR_ERR_CHARCNV, - "Bad char conversion"); + "Bad character conversion"); } } NDR_CHECK(ndr_pull_advance(ndr, (len1 + c_len_term)*byte_mul)); @@ -166,7 +166,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_string(struct ndr_pull *ndr, int ndr_flags, &converted_size, false)) { return ndr_pull_error(ndr, NDR_ERR_CHARCNV, - "Bad char conversion"); + "Bad character conversion"); } } NDR_CHECK(ndr_pull_advance(ndr, (len1 + c_len_term)*byte_mul)); @@ -201,7 +201,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_string(struct ndr_pull *ndr, int ndr_flags, &converted_size, false)) { return ndr_pull_error(ndr, NDR_ERR_CHARCNV, - "Bad char conversion"); + "Bad character conversion"); } } NDR_CHECK(ndr_pull_advance(ndr, (len3 + c_len_term)*byte_mul)); @@ -233,7 +233,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_string(struct ndr_pull *ndr, int ndr_flags, &converted_size, false)) { return ndr_pull_error(ndr, NDR_ERR_CHARCNV, - "Bad char conversion"); + "Bad character conversion"); } } NDR_CHECK(ndr_pull_advance(ndr, len3)); @@ -252,7 +252,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_string(struct ndr_pull *ndr, int ndr_flags, &converted_size, false)) { return ndr_pull_error(ndr, NDR_ERR_CHARCNV, - "Bad char conversion"); + "Bad character conversion"); } NDR_CHECK(ndr_pull_advance(ndr, len1)); *s = as; @@ -277,7 +277,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_string(struct ndr_pull *ndr, int ndr_flags, &converted_size, false)) { return ndr_pull_error(ndr, NDR_ERR_CHARCNV, - "Bad char conversion"); + "Bad character conversion"); } } NDR_CHECK(ndr_pull_advance(ndr, len1)); @@ -337,7 +337,7 @@ _PUBLIC_ enum ndr_err_code ndr_push_string(struct ndr_push *ndr, int ndr_flags, (void **)(void *)&dest, &d_len, false)) { return ndr_push_error(ndr, NDR_ERR_CHARCNV, - "Bad char conversion"); + "Bad character conversion"); } if (flags & LIBNDR_FLAG_STR_BYTESIZE) { @@ -652,7 +652,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_charset(struct ndr_pull *ndr, int ndr_flags, &converted_size, false)) { return ndr_pull_error(ndr, NDR_ERR_CHARCNV, - "Bad char conversion"); + "Bad character conversion"); } NDR_CHECK(ndr_pull_advance(ndr, length*byte_mul)); @@ -675,7 +675,7 @@ _PUBLIC_ enum ndr_err_code ndr_push_charset(struct ndr_push *ndr, int ndr_flags, ndr->data+ndr->offset, required, false); if (ret == -1) { return ndr_push_error(ndr, NDR_ERR_CHARCNV, - "Bad char conversion"); + "Bad character conversion"); } /* Make sure the remaining part of the string is filled with zeroes */ diff --git a/source4/librpc/ndr/ndr_string.c b/source4/librpc/ndr/ndr_string.c index 79548f81bc..a143284f17 100644 --- a/source4/librpc/ndr/ndr_string.c +++ b/source4/librpc/ndr/ndr_string.c @@ -587,8 +587,7 @@ _PUBLIC_ void ndr_print_string_array(struct ndr_print *ndr, const char *name, co ndr->depth++; for (i=0;i<count;i++) { char *idx=NULL; - asprintf(&idx, "[%d]", i); - if (idx) { + if (asprintf(&idx, "[%d]", i) != -1) { ndr_print_string(ndr, idx, a[i]); free(idx); } |