mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 14:35:26 +00:00
Remove redundant parentheses from the return statement
This commit is contained in:
@@ -86,7 +86,7 @@ isc_base64_totext(isc_region_t *source, int wordlength, const char *wordbreak,
|
||||
RETERR(str_totext(buf, target));
|
||||
isc_region_consume(source, 1);
|
||||
}
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
/*%
|
||||
@@ -113,33 +113,33 @@ base64_decode_char(base64_decode_ctx_t *ctx, int c) {
|
||||
const char *s;
|
||||
|
||||
if (ctx->seen_end) {
|
||||
return (ISC_R_BADBASE64);
|
||||
return ISC_R_BADBASE64;
|
||||
}
|
||||
if ((s = strchr(base64, c)) == NULL) {
|
||||
return (ISC_R_BADBASE64);
|
||||
return ISC_R_BADBASE64;
|
||||
}
|
||||
ctx->val[ctx->digits++] = (int)(s - base64);
|
||||
if (ctx->digits == 4) {
|
||||
int n;
|
||||
unsigned char buf[3];
|
||||
if (ctx->val[0] == 64 || ctx->val[1] == 64) {
|
||||
return (ISC_R_BADBASE64);
|
||||
return ISC_R_BADBASE64;
|
||||
}
|
||||
if (ctx->val[2] == 64 && ctx->val[3] != 64) {
|
||||
return (ISC_R_BADBASE64);
|
||||
return ISC_R_BADBASE64;
|
||||
}
|
||||
/*
|
||||
* Check that bits that should be zero are.
|
||||
*/
|
||||
if (ctx->val[2] == 64 && (ctx->val[1] & 0xf) != 0) {
|
||||
return (ISC_R_BADBASE64);
|
||||
return ISC_R_BADBASE64;
|
||||
}
|
||||
/*
|
||||
* We don't need to test for ctx->val[2] != 64 as
|
||||
* the bottom two bits of 64 are zero.
|
||||
*/
|
||||
if (ctx->val[3] == 64 && (ctx->val[2] & 0x3) != 0) {
|
||||
return (ISC_R_BADBASE64);
|
||||
return ISC_R_BADBASE64;
|
||||
}
|
||||
n = (ctx->val[2] == 64) ? 1 : (ctx->val[3] == 64) ? 2 : 3;
|
||||
if (n != 3) {
|
||||
@@ -157,25 +157,25 @@ base64_decode_char(base64_decode_ctx_t *ctx, int c) {
|
||||
RETERR(mem_tobuffer(ctx->target, buf, n));
|
||||
if (ctx->length >= 0) {
|
||||
if (n > ctx->length) {
|
||||
return (ISC_R_BADBASE64);
|
||||
return ISC_R_BADBASE64;
|
||||
} else {
|
||||
ctx->length -= n;
|
||||
}
|
||||
}
|
||||
ctx->digits = 0;
|
||||
}
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
base64_decode_finish(base64_decode_ctx_t *ctx) {
|
||||
if (ctx->length > 0) {
|
||||
return (ISC_R_UNEXPECTEDEND);
|
||||
return ISC_R_UNEXPECTEDEND;
|
||||
}
|
||||
if (ctx->digits != 0) {
|
||||
return (ISC_R_BADBASE64);
|
||||
return ISC_R_BADBASE64;
|
||||
}
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
@@ -215,9 +215,9 @@ isc_base64_tobuffer(isc_lex_t *lexer, isc_buffer_t *target, int length) {
|
||||
}
|
||||
RETERR(base64_decode_finish(&ctx));
|
||||
if (length == -2 && before == after) {
|
||||
return (ISC_R_UNEXPECTEDEND);
|
||||
return ISC_R_UNEXPECTEDEND;
|
||||
}
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
@@ -236,7 +236,7 @@ isc_base64_decodestring(const char *cstr, isc_buffer_t *target) {
|
||||
RETERR(base64_decode_char(&ctx, c));
|
||||
}
|
||||
RETERR(base64_decode_finish(&ctx));
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
@@ -248,12 +248,12 @@ str_totext(const char *source, isc_buffer_t *target) {
|
||||
l = strlen(source);
|
||||
|
||||
if (l > region.length) {
|
||||
return (ISC_R_NOSPACE);
|
||||
return ISC_R_NOSPACE;
|
||||
}
|
||||
|
||||
memmove(region.base, source, l);
|
||||
isc_buffer_add(target, l);
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
@@ -262,9 +262,9 @@ mem_tobuffer(isc_buffer_t *target, void *base, unsigned int length) {
|
||||
|
||||
isc_buffer_availableregion(target, &tr);
|
||||
if (length > tr.length) {
|
||||
return (ISC_R_NOSPACE);
|
||||
return ISC_R_NOSPACE;
|
||||
}
|
||||
memmove(tr.base, base, length);
|
||||
isc_buffer_add(target, length);
|
||||
return (ISC_R_SUCCESS);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
Reference in New Issue
Block a user