summaryrefslogtreecommitdiff
path: root/source3
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
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')
-rw-r--r--source3/client/clientutil.c2
-rw-r--r--source3/include/includes.h4
-rw-r--r--source3/lib/charset.c11
-rw-r--r--source3/printing/pcap.c4
-rw-r--r--source3/utils/make_smbcodepage.c10
5 files changed, 16 insertions, 15 deletions
diff --git a/source3/client/clientutil.c b/source3/client/clientutil.c
index 7c145bf59e..e3786d6029 100644
--- a/source3/client/clientutil.c
+++ b/source3/client/clientutil.c
@@ -908,7 +908,7 @@ BOOL cli_open_sockets(int port )
interpret_addr(lp_socket_address()))) != -1) {
set_socket_options(bcast, "SO_BROADCAST");
- if ((ip_list = name_query(bcast, host, name_type, True, True, *iface_bcast(dest_ip),
+ if (ip_list = name_query(bcast, host, name_type, True, True, *iface_bcast(dest_ip),
&count,0)) {
dest_ip = ip_list[0];
free(ip_list);
diff --git a/source3/include/includes.h b/source3/include/includes.h
index 3dbe6780a5..2d2ff63f88 100644
--- a/source3/include/includes.h
+++ b/source3/include/includes.h
@@ -1168,6 +1168,10 @@ extern char *sys_errlist[];
#include "kanji.h"
#include "charset.h"
+#ifndef MAXCODEPAGELINES
+#define MAXCODEPAGELINES 256
+#endif
+
/***** automatically generated prototypes *****/
#include "proto.h"
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;
}
/*******************************************************************
diff --git a/source3/printing/pcap.c b/source3/printing/pcap.c
index ff0a2b5477..bff81b8661 100644
--- a/source3/printing/pcap.c
+++ b/source3/printing/pcap.c
@@ -267,7 +267,7 @@ BOOL pcap_printername_ok(char *pszPrintername, char *pszPrintcapname)
#endif
#ifdef AIX
- if (strlocate(psz,"/qconfig") != NULL)
+ if (strlocate(psz,"/qconfig"))
return(ScanQconfig(psz,pszPrintername));
#endif
@@ -336,7 +336,7 @@ void pcap_printer_fn(void (*fn)())
#endif
#ifdef AIX
- if (strlocate(psz,"/qconfig") != NULL)
+ if (strlocate(psz,"/qconfig"))
{
ScanQconfig_fn(psz,fn);
return;
diff --git a/source3/utils/make_smbcodepage.c b/source3/utils/make_smbcodepage.c
index b4cb152334..06bc694e20 100644
--- a/source3/utils/make_smbcodepage.c
+++ b/source3/utils/make_smbcodepage.c
@@ -167,7 +167,7 @@ int do_compile(int codepage, char *input_file, char *output_file)
FILE *fp = NULL;
uint32 size = 0;
char *buf = NULL;
- char output_buf[CODEPAGE_HEADER_SIZE + 512];
+ char output_buf[CODEPAGE_HEADER_SIZE + 4 * MAXCODEPAGELINES];
int num_lines = 0;
int i = 0;
struct stat st;
@@ -223,11 +223,11 @@ The maximum size I will believe is 100k.\n", prog_name, size);
num_lines = clean_data( &buf, &size);
- /* There can be a maximum of 128 lines. */
- if(num_lines > 128)
+ /* There can be a maximum of MAXCODEPAGELINES lines. */
+ if(num_lines > MAXCODEPAGELINES)
{
- fprintf(stderr, "%s: There can be a maximum 128 lines of data in a codepage \
-definition file. File %s has %d.\n", prog_name, input_file, num_lines);
+ fprintf(stderr, "%s: There can be a maximum %d lines of data in a codepage \
+definition file. File %s has %d.\n", prog_name, MAXCODEPAGELINES, input_file, num_lines);
exit(1);
}