Re: [PATCH 21/37] iscsi-target: use native hex2bin for chap_string_to_hex

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Oct 14, 2011 at 3:41 AM, Nicholas A. Bellinger
<nab@xxxxxxxxxxxxxxx> wrote:

> (nab: Fix up minor compile breakage)
Am I late for comment?

> --- a/drivers/target/iscsi/iscsi_target_auth.c
> +++ b/drivers/target/iscsi/iscsi_target_auth.c

>  static int chap_string_to_hex(unsigned char *dst, unsigned char *src, int len)
>  {
> -       int i, j = 0;
> +       int j = DIV_ROUND_UP(len, 2);
>
> -       for (i = 0; i < len; i += 2) {
> -               dst[j++] = (unsigned char) chap_asciihex_to_binaryhex(&src[i]);
> -       }
> +       hex2bin(dst, src, len);
len in this case should be j. That's why in broken version it called
length. hex2bin accepts length in bytes to convert.

-- 
With Best Regards,
Andy Shevchenko
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux