convert string cleanup

Andrew Bartlett abartlet at
Tue Mar 29 17:59:55 MDT 2011

On Tue, 2011-03-29 at 16:53 -0700, Jeremy Allison wrote:
> On Wed, Mar 30, 2011 at 10:40:08AM +1100, Andrew Bartlett wrote:
> > Jeremy,
> > 
> > What are your plans for cleaning up the convert_string API that you
> > mentioned in your recent commit?
> > 
> > I'm just keen to ensure we don't step on each other's toes.  
> > 
> > For my part, I'm planning to add the requested tests for the two
> > convert_string implementations, using the handles in the samba4 side to
> > loop over multiple combinations of unix and dos charset, and deliberatly
> > using combinations of greek and ascii text to confirm both the fast and
> > slow paths. 
> I'm converting the convert_string API's to return a bool, rather
> than a size_t and return the converted_size as a size_t pointer
> parameter. I'm fixing both versions simultaneously - but not
> making any other changes (other than the ones needed to fix
> the callers).
> I'm trying to get these API's to the state where we never
> use the sort of idiom:
> pointer += convert_string(XXX)
> where we never correctly check that convert_string can have
> failed. It's not a massive change, so we shouldn't be getting
> in each other's way.

That sounds like a great improvement, thanks!

Andrew Bartlett

Andrew Bartlett                      
Authentication Developer, Samba Team 
Samba Developer, Cisco Inc.

More information about the samba-technical mailing list