librpc: Fix typos
[obnox/samba/samba-obnox.git] / librpc / ndr / ndr_nbt.c
index f2a1ca3ba5fff4f1f28f7c2037c38dbf60b2e870..838f947a16858a29aa1a3ffc1dc681f23b1b728d 100644 (file)
@@ -27,7 +27,7 @@
 #include "../libcli/netlogon/netlogon.h"
 
 /* don't allow an unlimited number of name components */
-#define MAX_COMPONENTS 10
+#define MAX_COMPONENTS 128
 
 /**
   print a nbt string
@@ -151,7 +151,7 @@ _PUBLIC_ enum ndr_err_code ndr_push_nbt_string(struct ndr_push *ndr, int ndr_fla
                size_t complen;
                uint32_t offset;
 
-               /* see if we have pushed the remaing string allready,
+               /* see if we have pushed the remaining string already,
                 * if so we use a label pointer to this string
                 */
                ndr_err = ndr_token_retrieve_cmp_fn(&ndr->nbt_string_list, s, &offset, (comparison_fn_t)strcmp, false);
@@ -179,6 +179,10 @@ _PUBLIC_ enum ndr_err_code ndr_push_nbt_string(struct ndr_push *ndr, int ndr_fla
                                              (unsigned)complen, (unsigned)complen);
                }
 
+               if (s[complen] == '.' && s[complen+1] == '\0') {
+                       complen++;
+               }
+
                compname = talloc_asprintf(ndr, "%c%*.*s",
                                                (unsigned char)complen,
                                                (unsigned char)complen,