n++;
}
- b[i++] = c;
+ if(i < n)
+ b[i++] = c;
}
return(i);
p = skip_string(p,1);
SSVAL(p,0,uLevel);
- SSVAL(p,2,0x2000); /* buf length */
+ SSVAL(p,2,BUFFER_SIZE - SAFETY_MARGIN); /* buf length */
p += 4;
svtype_p = p;
SIVAL(svtype_p,0,SV_TYPE_ALL);
if (call_api(PTR_DIFF(p+4,param),0,
- 8,10000,
+ 8,BUFFER_SIZE - SAFETY_MARGIN,
&rprcnt,&rdrcnt,
param,NULL,
&rparam,&rdata))
SIVAL(svtype_p,0,SV_TYPE_DOMAIN_ENUM);
if (call_api(PTR_DIFF(p+4,param),0,
- 8,10000,
+ 8,BUFFER_SIZE - SAFETY_MARGIN,
&rprcnt,&rdrcnt,
param,NULL,
&rparam,&rdata))
/* We *must* use toupper rather than tolower here due to the
asynchronous upper to lower mapping.
*/
-#ifdef KANJI
+#if defined(KANJI) && !defined(KANJI_WIN95_COMPATIBILITY)
+ /* Win95 treats full width ascii characters as case sensitive. */
int diff;
for (;;)
{
/* We *must* use toupper rather than tolower here due to the
asynchronous upper to lower mapping.
*/
-#ifdef KANJI
+#if defined(KANJI) && !defined(KANJI_WIN95_COMPATIBILITY)
+ /* Win95 treats full width ascii characters as case sensitive. */
int diff;
for (;n > 0;)
{
{
while (*s)
{
-#ifdef KANJI
+#if defined(KANJI) && !defined(KANJI_WIN95_COMPATIBILITY)
+ /* Win95 treats full width ascii characters as case sensitive. */
if (is_shift_jis (*s)) {
if (is_sj_upper (s[0], s[1])) {
s[1] = sj_tolower2 (s[1]);
{
while (*s)
{
-#ifdef KANJI
+#if defined(KANJI) && !defined(KANJI_WIN95_COMPATIBILITY)
+ /* Win95 treats full width ascii characters as case sensitive. */
if (is_shift_jis (*s)) {
if (is_sj_lower (s[0], s[1])) {
s[1] = sj_toupper2 (s[1]);
{
while (*s)
{
-#ifdef KANJI
+#if defined(KANJI) && !defined(KANJI_WIN95_COMPATIBILITY)
+ /* Win95 treats full width ascii characters as case sensitive. */
if (is_shift_jis (*s)) {
s += 2;
} else if (is_kana (*s)) {
if (j == 7) DEBUG(10, (" "));
}
- DEBUG(10,("\n"));
- }
+ DEBUG(10,("\n"));
+}
}
/*******************************************************************
{
while (*s)
{
-#ifdef KANJI
+#if defined(KANJI) && !defined(KANJI_WIN95_COMPATIBILITY)
+ /* Win95 treats full width ascii characters as case sensitive. */
if (is_shift_jis (*s)) {
s += 2;
} else if (is_kana (*s)) {
{
while (*s)
{
-#ifdef KANJI
+#if defined(KANJI) && !defined(KANJI_WIN95_COMPATIBILITY)
+ /* Win95 treats full width ascii characters as case sensitive. */
if (is_shift_jis (*s)) {
if (is_sj_upper (s[0], s[1])) return(True);
if (is_sj_lower (s[0], s[1])) return (True);
int count_chars(char *s,char c)
{
int count=0;
-#ifdef KANJI
- while (*s)
- {
+#if defined(KANJI) && !defined(KANJI_WIN95_COMPATIBILITY)
+ /* Win95 treats full width ascii characters as case sensitive. */
+ while (*s)
+ {
if (is_shift_jis (*s))
s += 2;
else
{
- if (*s == c)
- count++;
- s++;
- }
+ if (*s == c)
+ count++;
+ s++;
+ }
}
#else /* KANJI */
while (*s)
Paul Rippin <pr3245@nopc.eurostat.cec.be>
********************************************************************/
void standard_sub_basic(char *string)
-{
+ {
char *s, *p;
- char pidstr[10];
+ char pidstr[10];
struct passwd *pass;
for (s = string ; (p = strchr(s,'%')) != NULL ; s = p )
{
switch (*(p+1))
- {
+ {
case 'G' : if ((pass = Get_Pwnam(sesssetup_user,False))!=NULL)
string_sub(p,"%G",gidtoname(pass->pw_gid));
else
/* if we have no list it's obviously not in the path */
if((namelist == NULL ) || ((namelist != NULL) && (namelist[0].name == NULL)))
- {
+ {
DEBUG(5,("is_in_path: no name list.\n"));
return False;
- }
+}
/* Get the last component of the unix name. */
p = strrchr(name, '/');
}
}
DEBUG(5,("is_in_path: match not found\n"));
-
+
return False;
}
* We also check if the entry contains a wildcard to
* remove a potentially expensive call to mask_match
* if possible.
- */
+ */
void set_namearray(name_compare_entry **ppname_array, char *namelist)
{
first to count the number of elements, the second
to split it.
*/
- while (*nameptr )
+ while(*nameptr)
{
if ( *nameptr == '/' )
- {
+ {
/* cope with multiple (useless) /s) */
nameptr++;
continue;
- }
+ }
/* find the next / */
name_end = strchr(nameptr, '/');
if(( (*ppname_array) = (name_compare_entry *)malloc(
(num_entries + 1) * sizeof(name_compare_entry))) == NULL)
- {
+ {
DEBUG(0,("set_namearray: malloc fail\n"));
return;
- }
+ }
/* Now copy out the names */
nameptr = namelist;
i = 0;
while(*nameptr)
- {
+ {
if ( *nameptr == '/' )
{
/* cope with multiple (useless) /s) */
if ((name_end = strchr(nameptr, '/')) != NULL)
{
*name_end = 0;
- }
+ }
/* oops - the last check for a / didn't find one. */
- if (name_end == NULL)
+ if(name_end == NULL)
break;
(*ppname_array)[i].is_wild = ((strchr( nameptr, '?')!=NULL) ||
nameptr = name_end + 1;
i++;
}
-
+
(*ppname_array)[i].name = NULL;
return;
p = skip_string(p,1);
SSVAL(p,0,uLevel);
- SSVAL(p,2,0x2000); /* buf length */
+ SSVAL(p,2,BUFFER_SIZE - SAFETY_MARGIN); /* buf length */
p += 4;
SIVAL(p,0,servertype);
p += 4;
strcpy(p, work->work_group);
p = skip_string(p,1);
- if (cli_call_api(PTR_DIFF(p,param),0, 8,10000,
+ if (cli_call_api(PTR_DIFF(p,param),0, 8,BUFFER_SIZE - SAFETY_MARGIN,
&rprcnt,&rdrcnt, param,NULL,
&rparam,&rdata))
{