the conversion from int to size_t in charcnv did not take into account
authorAndrew Tridgell <tridge@samba.org>
Mon, 2 Feb 2004 12:02:43 +0000 (12:02 +0000)
committerAndrew Tridgell <tridge@samba.org>
Mon, 2 Feb 2004 12:02:43 +0000 (12:02 +0000)
commit8b8f0c527959c707f274b435fc59156e37232981
tree80b190fff3380a7f80fd07110cc25b43a2b48fc0
parente3a5e2d9c23e8ba6bc817e433e596f535644c862
the conversion from int to size_t in charcnv did not take into account
one place where we checked "if (src_len > 0)".

I actually would greatly prefer to switch back to int for src_len. The
type *can* be negative, which means an unsigned type is
inappropriate. There is absolutely no reason why "int" should not be
used for a parameter like this.

I didn't change back to int as we are close to a release and I wanted
a mininal change, but please don't go changing types like this in
future without very careful testing and a damn good reason.

this bug broke pull_ucs2(), I would not be surprised if it caused all
sorts of nastiness. Thanks to vl for noticing the symptoms!
source/lib/charcnv.c