summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-01-16 06:29:38 +0000
committerJeremy Allison <jra@samba.org>1998-01-16 06:29:38 +0000
commitfec28f2defa17974b2eaafdd10599cf37850ca16 (patch)
treefb3fec96d97e5f7665e8f5c0df01642d4f08f764 /source3/lib
parent7ab9d270fe9fcc0360672ff8e163aba985c69aea (diff)
downloadsamba-fec28f2defa17974b2eaafdd10599cf37850ca16.tar.gz
samba-fec28f2defa17974b2eaafdd10599cf37850ca16.tar.bz2
samba-fec28f2defa17974b2eaafdd10599cf37850ca16.zip
Makefile: Added new codepage - 866.
charset.c: Supporting code for codepage 866. clientutil.c: Fix compile bug in little-used #define. includes.h: Supporting code for codepage 866. make_smbcodepage.c: Supporting code for codepage 866. pcap.c: Fix bug for lpstat. Jeremy. (This used to be commit 6040d7a39e5d5ab426905aa79b871df815fb9b62)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/charset.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/source3/lib/charset.c b/source3/lib/charset.c
index e29e60303a..95b3d01627 100644
--- a/source3/lib/charset.c
+++ b/source3/lib/charset.c
@@ -216,11 +216,11 @@ static codepage_p load_client_codepage( int client_codepage )
/* Check if it is at least big enough to hold the required
data. Should be 2 byte version, 2 byte codepage, 4 byte length,
plus zero or more bytes of data. Note that the data cannot be more
- than 512 bytes - giving a max size of 520.
+ than 4 * MAXCODEPAGELINES bytes.
*/
size = (unsigned int)st.st_size;
- if( size < CODEPAGE_HEADER_SIZE || size > (CODEPAGE_HEADER_SIZE + 256))
+ if( size < CODEPAGE_HEADER_SIZE || size > (CODEPAGE_HEADER_SIZE + 4 * MAXCODEPAGELINES))
{
DEBUG(0,("load_client_codepage: file %s is an incorrect size for a \
code page file.\n", codepage_file_name));
@@ -323,10 +323,9 @@ initialise the client codepage.
void codepage_initialise(int client_codepage)
{
int i;
- codepage_p cp = NULL;
- static BOOL done = False;
+ static codepage_p cp = NULL;
- if(done == True)
+ if(cp != NULL)
{
DEBUG(6,
("codepage_initialise: called twice - ignoring second client code page = %d\n",
@@ -361,8 +360,6 @@ for code page %d failed. Using default client codepage 850\n",
for(i = 0; !((cp[i][0] == '\0') && (cp[i][1] == '\0')); i++)
add_dos_char(cp[i][0], (BOOL)cp[i][2], cp[i][1], (BOOL)cp[i][3]);
}
-
- done = True;
}
/*******************************************************************