Bug 3796 - strnlen function prototype not included correctly
strnlen function prototype not included correctly
Status: NEW
Product: Samba 3.0
Classification: Unclassified
Component: nmbd
3.0.22
All All
: P3 normal
: none
Assigned To: Samba Bugzilla Account
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-05-22 20:23 UTC by Peter Maguire
Modified: 2006-05-23 22:32 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Maguire 2006-05-22 20:23:23 UTC
strnlen function prototype not included correctly

in includes.h

change #ifndef HAVE_STRNLEN

to #if !defined(HAVE_STRNLEN) || defined(BROKEN_STRNLEN)

ENV
AIX 4.3
gcc 3.4.3
Comment 1 William Jojo 2006-05-23 15:30:54 UTC
Peter,

Is strnlen not defined in /usr/include/string.h for 4.3? That's the only time this should matter. Are you receiveing a specific build error for this?

Bill
Comment 2 Peter Maguire 2006-05-23 22:32:01 UTC
Yes, a incompatible declaration for strnlen error on compile of util_str.c, line 1665 as below and

#if !defined(HAVE_STRNLEN) || defined(BROKEN_STRNLEN)
/**
 Some platforms don't have strnlen
**/

/*line 1665 */ size_t strnlen(const char *s, size_t n) {
	size_t i;
	for (i=0; i<n && s[i] != '\0'; i++)
		/* noop */ ;
	return i;
}
#endif


And line 598


	if (!src) {
		*dest = 0;
		return dest;
	}  

/* line 598 */	len = strnlen(src, maxlength+1);


change to includes.h fixed

(In reply to comment #0)
> strnlen function prototype not included correctly
> 
> in includes.h
> 
> change #ifndef HAVE_STRNLEN
> 
> to #if !defined(HAVE_STRNLEN) || defined(BROKEN_STRNLEN)
> 
> ENV
> AIX 4.3
> gcc 3.4.3
>