summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-06-22 01:39:17 +0000
committerJeremy Allison <jra@samba.org>2000-06-22 01:39:17 +0000
commitf9e9f98a4a579f24d8ad1804b22bf36ede250e23 (patch)
tree23a89fdcc3b34315bbc8625ec3cffd4460ec8608 /source3/lib
parenta7b5b10a0a32dd9a3f82c600898393fc53cfc4fc (diff)
downloadsamba-f9e9f98a4a579f24d8ad1804b22bf36ede250e23.tar.gz
samba-f9e9f98a4a579f24d8ad1804b22bf36ede250e23.tar.bz2
samba-f9e9f98a4a579f24d8ad1804b22bf36ede250e23.zip
lib/util_unistr.c: Removed ascii_to_unistr() as it does no codepage.
Removed unistr_to_ascii() as it was never used. printing/nt_printing.c: Removed "DUMMY.XX" files. rpc_server/srv_spoolss_nt.c: Use dos_PutUniCode() instead of ascii_to_unistr(). Attempted to fix the "return value" size code based on J.F's comments. This needs looking at. Jeremy. (This used to be commit de99011bf3b2a23bd1854a047382a107aaeb9c68)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/util_unistr.c51
1 files changed, 3 insertions, 48 deletions
diff --git a/source3/lib/util_unistr.c b/source3/lib/util_unistr.c
index 792cf2384a..d4a159a28e 100644
--- a/source3/lib/util_unistr.c
+++ b/source3/lib/util_unistr.c
@@ -48,13 +48,13 @@ static uint16 *ucs2_to_unixcp;
if null_terminate is True then null terminate the packet (adds 2 bytes)
- the return value is the length consumed by the string, including the
+ the return value is the length in bytes consumed by the string, including the
null termination if applied
********************************************************************/
-int dos_PutUniCode(char *dst,const char *src, ssize_t len, BOOL null_terminate)
+size_t dos_PutUniCode(char *dst,const char *src, ssize_t len, BOOL null_terminate)
{
- int ret = 0;
+ size_t ret = 0;
while (*src && (len > 2)) {
size_t skip = get_character_len(*src);
smb_ucs2_t val = (*src & 0xff);
@@ -84,51 +84,6 @@ int dos_PutUniCode(char *dst,const char *src, ssize_t len, BOOL null_terminate)
}
/*******************************************************************
- Put an ASCII string into a UNICODE string.
-
- Warning: doesn't do any codepage !!! BAD !!!
-
- Help ! Fix Me ! Fix Me !
-********************************************************************/
-
-void ascii_to_unistr(char *dest, const char *src, size_t maxlen)
-{
- char *destend = dest + maxlen;
- char c;
-
- while (dest < destend) {
- c = *(src++);
- if (c == 0) break;
-
- SSVAL(dest, 0, (uint16)c);
- dest += 2;
- }
- SSVAL(dest, 0, 0);
-}
-
-/*******************************************************************
- * HORRIBLE HACK!
-********************************************************************/
-void unistr_to_ascii(char *dest, const uint16 *src, int len)
-{
- char *destend = dest + len;
- register uint16 c;
-
- while (dest < destend)
- {
- c = *(src++);
- if (c == 0)
- {
- break;
- }
-
- *(dest++) = (char)c;
- }
-
- *dest = 0;
-}
-
-/*******************************************************************
Pull a DOS codepage string out of a UNICODE array. len is in bytes.
********************************************************************/