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.
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);
#include "kanji.h"
#include "charset.h"
+#ifndef MAXCODEPAGELINES
+#define MAXCODEPAGELINES 256
+#endif
+
/***** automatically generated prototypes *****/
#include "proto.h"
/* 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));
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",
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;
}
/*******************************************************************
#endif
#ifdef AIX
- if (strlocate(psz,"/qconfig") != NULL)
+ if (strlocate(psz,"/qconfig"))
return(ScanQconfig(psz,pszPrintername));
#endif
#endif
#ifdef AIX
- if (strlocate(psz,"/qconfig") != NULL)
+ if (strlocate(psz,"/qconfig"))
{
ScanQconfig_fn(psz,fn);
return;
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;
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);
}