* as valid BER tags, and so it is safe to use them to report errors. In
* fact, any tag for which the following is true is invalid:
*/
-#define LBER_INVALID(t) (((t) & (ber_tag_t) 0x080) \
+#define LBER_INVALID(t) (((t) & (ber_tag_t) 0x080UL) \
&& (((t) & (ber_tag_t) ~ 0x0FF))
#define LBER_ERROR ((ber_tag_t) -1)
#ifdef STR_TRANSLATION
if ( len > 0 && ( ber->ber_options & LBER_TRANSLATE_STRINGS ) != 0 &&
ber->ber_encode_translate_proc ) {
- if ( (*(ber->ber_encode_translate_proc))( &str, &len, 0 )
- != 0 ) {
+ if ( (*(ber->ber_encode_translate_proc))( &str, &len, 0 ) != 0 ) {
return( -1 );
}
free_str = 1;
assert( ber_int_memory_fns->bmf_free );
-
(*ber_int_memory_fns->bmf_free)( p );
}
ber_int_options.lbo_valid = LBER_INITIALIZED;
if( bv == NULL ) {
+ ber_errno = LBER_ERROR_PARAM;
return NULL;
}
if(( new = LBER_MALLOC( sizeof(struct berval) )) == NULL ) {
+ ber_errno = LBER_ERROR_MEMORY;
return NULL;
}
}
if(( new->bv_val = LBER_MALLOC( bv->bv_len + 1 )) == NULL ) {
+ ber_errno = LBER_ERROR_MEMORY;
LBER_FREE( new );
return NULL;
}
len = strlen( s ) + 1;
if ( (p = LBER_MALLOC( len )) == NULL ) {
+ ber_errno = LBER_ERROR_MEMORY;
return( NULL );
}
if(outvalue == NULL) {
/* no place to get to */
+ ber_errno = LBER_ERROR_PARAM;
return LBER_OPT_ERROR;
}
return LBER_OPT_SUCCESS;
}
+ ber_errno = LBER_ERROR_PARAM;
return LBER_OPT_ERROR;
}
default:
/* bad param */
+ ber_errno = LBER_ERROR_PARAM;
break;
}
if(!( f->bmf_malloc && f->bmf_calloc
&& f->bmf_realloc && f->bmf_free ))
{
+ ber_errno = LBER_ERROR_PARAM;
return LBER_OPT_ERROR;
}
(*(f->bmf_malloc))(sizeof(BerMemoryFunctions));
if ( ber_int_memory_fns == NULL ) {
+ ber_errno = LBER_ERROR_MEMORY;
return LBER_OPT_ERROR;
}
if(invalue == NULL) {
/* no place to set from */
+ ber_errno = LBER_ERROR_PARAM;
return LBER_OPT_ERROR;
}
return LBER_OPT_SUCCESS;
}
+ ber_errno = LBER_ERROR_PARAM;
return LBER_OPT_ERROR;
}
default:
/* bad param */
+ ber_errno = LBER_ERROR_PARAM;
break;
}