mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
r13186: Remove assumption that callers that specify -1 actually mean sizeof(pstring)
This commit is contained in:
parent
841fb3d4e7
commit
da72f47226
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user