From fec28f2defa17974b2eaafdd10599cf37850ca16 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 16 Jan 1998 06:29:38 +0000 Subject: 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) --- source3/lib/charset.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'source3/lib') 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; } /******************************************************************* -- cgit