#include <stdio.h>
#include <stdlib.h>
+#include <ac/ctype.h>
+#include <ac/errno.h>
+#include <ac/socket.h>
#include <ac/string.h>
-#include <ctype.h>
#include <ac/unistd.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <ac/socket.h>
-
#ifdef HAVE_IO_H
#include <io.h>
#endif
-#include "lber.h"
+#include "lber-int.h"
static int ber_realloc LDAP_P(( BerElement *ber, unsigned long len ));
static int ber_filbuf LDAP_P(( Sockbuf *sb, long len ));
#endif /* LDAP_CONNECTIONLESS */
} else {
rc = read( sb->sb_sd, sb->sb_ber.ber_buf,
- ((sb->sb_options & LBER_NO_READ_AHEAD) &&
- (len < READBUFSIZ)) ?
- len : READBUFSIZ );
+ ((sb->sb_options & LBER_NO_READ_AHEAD) && (len < READBUFSIZ)) ?
+ len : READBUFSIZ );
}
if ( rc > 0 ) {
break;
return( c );
}
- *buf++ = c;
+ *buf++ = (char) c;
nread++;
len--;
}
/* fake error if write was not atomic */
if (rc < towrite) {
-#if !defined(MACOS) && !defined(DOS)
+#ifdef EMSGSIZE
errno = EMSGSIZE;
#endif
return( -1 );
if ( (ber = (BerElement *) calloc( 1, sizeof(BerElement) )) == NULLBER )
return( NULLBER );
ber->ber_tag = LBER_DEFAULT;
- ber->ber_options = options;
+ ber->ber_options = (char) options;
return( ber );
}
{
(void) memset( (char *)ber, '\0', sizeof( BerElement ));
ber->ber_tag = LBER_DEFAULT;
- ber->ber_options = options;
+ ber->ber_options = (char) options;
}