ret is a bool and size is what we are looking for here, else the
statement can never be true.
Jeremy please check!
Found by Coverity.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
smb_ucs2_t *dest_ucs2 = (smb_ucs2_t *)dest;
size_t i;
- /* We check for i < (ret / 2) below as the dest string isn't null
+ /* We check for i < (size / 2) below as the dest string isn't null
terminated if STR_TERMINATE isn't set. */
- for (i = 0; i < (ret / 2) && i < (dest_len / 2) && dest_ucs2[i]; i++) {
+ for (i = 0; i < (size / 2) && i < (dest_len / 2) && dest_ucs2[i]; i++) {
smb_ucs2_t v = toupper_w(dest_ucs2[i]);
if (v != dest_ucs2[i]) {
dest_ucs2[i] = v;