Re: [PATCH 5/8] Better support of virtual console

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

 



On Fri, Apr 29, 2011 at 01:46:32PM +0200, Karel Zak wrote:
> On Thu, Apr 28, 2011 at 04:56:33PM +0200, Werner Fink wrote:
> > +	if ((op->flags & F_UTF8) && (ic = iconv_open("WCHAR_T", "UTF-8"))) {
> > +		char tmpbuf[4*sizeof(logname)], *optr, *lptr;
> > +		size_t len = bp - logname;
> > +		size_t out = sizeof(tmpbuf) - 1;
> > +		size_t wcl;
> > +		wint_t *wcp;
> > +
> > +		/* Handle UTF-8 multibyte characters */
> > +		optr = tmpbuf;
> > +		lptr = logname;
> > +		if ((wcl = iconv(ic , &lptr, &len, &optr, &out)) == (size_t)-1)
> > +			error ("%s: invalid character conversion for login name", op->tty);
> > +		iconv_close(ic);
> 
>  Would be enough to use mbstowcs()? The iconv seems like a huge hammer
>  here :-) 

True, thanks for spotting :)

   Werner

-- 
  "Having a smoking section in a restaurant is like having
          a peeing section in a swimming pool." -- Edward Burr
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux