User Interface: error in own recent commit, replacing loop with memset

This commit is contained in:
2013-12-03 09:10:55 +11:00
parent 93b24b91a9
commit a169a109e5

View File

@@ -1604,7 +1604,7 @@ void ui_button_text_password_hide(char password_str[UI_MAX_DRAW_STR], uiBut *but
} }
else { else {
/* convert text to hidden test using asterisks (e.g. pass -> ****) */ /* convert text to hidden test using asterisks (e.g. pass -> ****) */
int i, len = BLI_strlen_utf8(but->drawstr); const size_t len = BLI_strlen_utf8(but->drawstr);
/* remap cursor positions */ /* remap cursor positions */
if (but->pos >= 0) { if (but->pos >= 0) {
@@ -1617,7 +1617,7 @@ void ui_button_text_password_hide(char password_str[UI_MAX_DRAW_STR], uiBut *but
BLI_strncpy(password_str, but->drawstr, UI_MAX_DRAW_STR); BLI_strncpy(password_str, but->drawstr, UI_MAX_DRAW_STR);
memset(but->drawstr, '*', len); memset(but->drawstr, '*', len);
but->drawstr[i] = '\0'; but->drawstr[len] = '\0';
} }
} }