From 3462b0dc20f1df61b8f4bfdb79e21103a0d0a8ff Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Thu, 7 Nov 2002 20:14:19 +0000 Subject: [PATCH] * conv_princ.c (strnchr): Make length argument unsigned int * preauth2.c: Add parentheses around assignment used as truth value. Cleanup unused variable. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14976 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/krb/ChangeLog | 8 ++++++++ src/lib/krb5/krb/conv_princ.c | 5 +++-- src/lib/krb5/krb/preauth2.c | 14 +++++++------- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/lib/krb5/krb/ChangeLog b/src/lib/krb5/krb/ChangeLog index 5ed7fe71f..43df45417 100644 --- a/src/lib/krb5/krb/ChangeLog +++ b/src/lib/krb5/krb/ChangeLog @@ -1,3 +1,11 @@ +2002-11-07 Ezra Peisach + + * conv_princ.c (strnchr): Make length argument unsigned int. + + * preauth2.c: Add parentheses around assignment used as truth + value. Cleanup unused variable. + + 2002-10-30 Tom Yu * chk_trans.c (krb5_check_transited_list): Style nit: check diff --git a/src/lib/krb5/krb/conv_princ.c b/src/lib/krb5/krb/conv_princ.c index 6eb157aca..a4d04e89a 100644 --- a/src/lib/krb5/krb/conv_princ.c +++ b/src/lib/krb5/krb/conv_princ.c @@ -119,7 +119,7 @@ static const struct krb_convert sconv_list[] = { * char *strnchr(s, c, n) * char *s; * char c; - * int n; + * unsigned int n; * * returns a pointer to the first occurrence of character c in the * string s, or a NULL pointer if c does not occur in in the string; @@ -128,7 +128,8 @@ static const struct krb_convert sconv_list[] = { * This falls in the "should have been in the ANSI C library" * category. :-) */ -static char *strnchr(register char *s, register char c, register int n) +static char *strnchr(register char *s, register char c, + register unsigned int n) { if (n < 1) return 0; diff --git a/src/lib/krb5/krb/preauth2.c b/src/lib/krb5/krb/preauth2.c index 440690bc9..f99379fa2 100644 --- a/src/lib/krb5/krb/preauth2.c +++ b/src/lib/krb5/krb/preauth2.c @@ -282,8 +282,8 @@ krb5_error_code pa_sam(krb5_context context, if (etype && *etype == 0) *etype = ENCTYPE_DES_CBC_CRC; - if (ret = (gak_fct)(context, request->client, *etype, prompter, - prompter_data, salt, as_key, gak_data)) + if ((ret = (gak_fct)(context, request->client, *etype, prompter, + prompter_data, salt, as_key, gak_data))) return(ret); } sprintf(name, "%.*s", @@ -501,7 +501,7 @@ krb5_error_code pa_sam_2(krb5_context context, tmp_data.length = in_padata->length; tmp_data.data = (char *)in_padata->contents; - if (retval = decode_krb5_sam_challenge_2(&tmp_data, &sc2)) + if ((retval = decode_krb5_sam_challenge_2(&tmp_data, &sc2))) return(retval); retval = decode_krb5_sam_challenge_2_body(&sc2->sam_challenge_2_body, &sc2b); @@ -573,8 +573,8 @@ krb5_error_code pa_sam_2(krb5_context context, prompt_type = KRB5_PROMPT_TYPE_PREAUTH; krb5int_set_prompt_types(context, &prompt_type); - if (retval = ((*prompter)(context, prompter_data, name, - banner, 1, &kprompt))) { + if ((retval = ((*prompter)(context, prompter_data, name, + banner, 1, &kprompt)))) { krb5_free_sam_challenge_2(context, sc2); krb5_free_sam_challenge_2_body(context, sc2b); krb5int_set_prompt_types(context, 0); @@ -585,7 +585,8 @@ krb5_error_code pa_sam_2(krb5_context context, /* Generate salt used by string_to_key() */ if ((salt->length == -1) && (salt->data == NULL)) { - if (retval = krb5_principal2salt(context, request->client, &defsalt)) { + if ((retval = + krb5_principal2salt(context, request->client, &defsalt))) { krb5_free_sam_challenge_2(context, sc2); krb5_free_sam_challenge_2_body(context, sc2b); return(retval); @@ -598,7 +599,6 @@ krb5_error_code pa_sam_2(krb5_context context, /* Get encryption key to be used for checksum and sam_response */ if (!(sc2b->sam_flags & KRB5_SAM_USE_SAD_AS_KEY)) { /* as_key = string_to_key(password) */ - int i; if (as_key->length) { krb5_free_keyblock_contents(context, as_key); -- 2.26.2