Re: [PATCH] get_line fixes for wide characters and overflows

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

 



On Sat, Aug 03, 2013 at 01:38:30PM +0100, Dr. David Alan Gilbert wrote:
> u mean. So I have added p < &Line[LineLen - 1]
> >  check to the for() where the code copies the multibyte buffer to line buffer.
> >  See git tree for more details.
> 
> OK; so I think with your ...ea608842 change then it should work (not tried
> to push it); but with that change hopefully the extra check in ..623bc74f
> should never trigger; which is good because if it does then I think you'll
> end up outputing part of a wide character which would get messy.
> 
> One thing I tried to do in my change was remove the magic '4's that
> pop up in a few places because of the wide characters.

then it would be better to use #define ...

Anyway, the more.c code is so horrible that it does not make sense to
waste time to try to make it perfect. It would be better to do
complete refactoring (some control struct, small functions, no global
variables, etc.)

> (Any particular reason you prefered this over my fix?)

Unfortunately I somehow missed the widechar issue in my first commit,
so your original patch was no bad (except the global const variables).

Thanks, look forward to see more patches from you :-)

    Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com
--
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