r13186: Remove assumption that callers that specify -1 actually mean sizeof(pstring)
authorJelmer Vernooij <jelmer@samba.org>
Fri, 27 Jan 2006 13:29:47 +0000 (13:29 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:51:32 +0000 (13:51 -0500)
(This used to be commit da72f47226f9c514deb75bc6e69548c240822eb5)

source4/lib/charset/charcnv.c

index e6327901556bb3b4dc64f7102e66b850059f866a..6f07d78fb162b8bc68db48e0c750d5a886a6aa83 100644 (file)
@@ -22,7 +22,6 @@
 */
 #include "includes.h"
 #include "system/iconv.h"
-#include "pstring.h"
 
 /**
  * @file
@@ -303,10 +302,6 @@ ssize_t push_ascii(void *dest, const char *src, size_t dest_len, int flags)
                return ret;
        }
 
-       /* treat a pstring as "unlimited" length */
-       if (dest_len == (size_t)-1)
-               dest_len = sizeof(pstring);
-
        src_len = strlen(src);
 
        if (flags & (STR_TERMINATE | STR_TERMINATE_ASCII))
@@ -352,9 +347,6 @@ ssize_t pull_ascii(char *dest, const void *src, size_t dest_len, size_t src_len,
 {
        size_t ret;
 
-       if (dest_len == (size_t)-1)
-               dest_len = sizeof(pstring);
-
        if (flags & (STR_TERMINATE | STR_TERMINATE_ASCII)) {
                if (src_len == (size_t)-1) {
                        src_len = strlen(src) + 1;
@@ -406,10 +398,6 @@ ssize_t push_ucs2(void *dest, const char *src, size_t dest_len, int flags)
                return ret;
        }
 
-       /* treat a pstring as "unlimited" length */
-       if (dest_len == (size_t)-1)
-               dest_len = sizeof(pstring);
-
        if (flags & STR_TERMINATE)
                src_len++;
 
@@ -482,9 +470,6 @@ size_t pull_ucs2(char *dest, const void *src, size_t dest_len, size_t src_len, i
 {
        size_t ret;
 
-       if (dest_len == (size_t)-1)
-               dest_len = sizeof(pstring);
-
        if (ucs2_align(NULL, src, flags)) {
                src = (const void *)((const char *)src + 1);
                if (src_len > 0)