]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r267436-267439:
authortijl <tijl@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Fri, 20 Jun 2014 07:32:03 +0000 (07:32 +0000)
committertijl <tijl@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Fri, 20 Jun 2014 07:32:03 +0000 (07:32 +0000)
commit16eb12273ca998468eb16eac31bb6e8ad27965f3
tree60af671abf1bc0d1bc97daa15754adcb118b899b
parent4c225e1861dbe752bba2c312d2b6d0dd93ba4e06
MFC r267436-267439:

- Replace malloc+memset with calloc.
- iconv_open(3): initialise ci_ilseq_invalid field of _citrus_iconv_shared
  struct after allocation with malloc.
- iconvlist(3): reduce a memory leak by copying strings only once.
- iconv(1):
  - Make invalids variable local to do_conv such that it prints the number
    of invalid characters of the current file instead of an accumulated
    value.
  - Make do_conv return an error when invalid characters have been found.
    Return EXIT_FAILURE from main if any file contained invalid characters.
    This matches the behaviour of GNU iconv.
  - Mark usage with __dead2 attribute.
  - Make the long_options array const.

Tested by: Pavel Timofeev <timp87@gmail.com>

git-svn-id: svn://svn.freebsd.org/base/stable/10@267665 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
lib/libc/iconv/bsd_iconv.c
lib/libc/iconv/citrus_db_factory.c
lib/libc/iconv/citrus_iconv.c
lib/libiconv_modules/HZ/citrus_hz.c
usr.bin/iconv/iconv.c