diff options
author | Greg Hudson <ghudson@mit.edu> | 2013-04-09 11:43:54 -0400 |
---|---|---|
committer | Greg Hudson <ghudson@mit.edu> | 2013-04-09 11:43:54 -0400 |
commit | 893a178cbdc03ee9d1936c95a3f567cb2796420d (patch) | |
tree | 3ce75b3146a56ac42bd5e2b88916da8cf1faf63e | |
parent | 31124ffb81e8c0935403a9fdc169dead5ecaa777 (diff) | |
download | krb5-893a178cbdc03ee9d1936c95a3f567cb2796420d.tar.gz krb5-893a178cbdc03ee9d1936c95a3f567cb2796420d.tar.xz krb5-893a178cbdc03ee9d1936c95a3f567cb2796420d.zip |
Initialize outpos in krb5int_utf8_normalize
After k5memdup0 was slightly modified in
31124ffb81e8c0935403a9fdc169dead5ecaa777, some older versions of gcc
complain about outpos being possibly used before it is initialized.
This can't actually happen, but we can silence the error and also
simplify how outpos is initialized.
-rw-r--r-- | src/lib/krb5/unicode/ucstr.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/lib/krb5/unicode/ucstr.c b/src/lib/krb5/unicode/ucstr.c index 38d8d47d02..ea96335ef6 100644 --- a/src/lib/krb5/unicode/ucstr.c +++ b/src/lib/krb5/unicode/ucstr.c @@ -109,7 +109,7 @@ krb5int_utf8_normalize( krb5_data ** newdataptr, unsigned flags) { - int i, j, len, clen, outpos, ucsoutlen, outsize; + int i, j, len, clen, outpos = 0, ucsoutlen, outsize; char *out = NULL, *outtmp, *s; krb5_ucs4 *ucs = NULL, *p, *ucsout = NULL; krb5_data *newdata; @@ -144,7 +144,6 @@ krb5int_utf8_normalize( retval = ENOMEM; goto cleanup; } - outpos = 0; for (i = 1; (i < len) && KRB5_UTF8_ISASCII(s + i); i++) { out[outpos++] = TOLOWER(s[i - 1]); @@ -182,7 +181,6 @@ krb5int_utf8_normalize( retval = ENOMEM; goto cleanup; } - outpos = 0; i = 0; } |