On Wed, Mar 25, 2009 at 02:46:36AM -0700, Guy Harris wrote:
> On Mar 25, 2009, at 2:23 AM, Joerg Mayer wrote:
>
> > The problem seems to be that only the last two characters are shown
> > instead
> > of the full length string. A problem with g_snprintf may be that it
> > doesn't like to use a rhs argument as its lhs result.
>
> Not that you should be doing that anyway.
>
> What they're doing is attempting to append to a string buffer.
>
> There's a somewhat ugly idiom, used in a number of places, to do that
> with g_snprintf(); it's probably faster, as you don't have to copy the
> string on top of itself.
>
> Then again, if they want capital letters for hex digits, they could
> just use bytes_to_str() in most if not all of those cases, and if they
> want lower-case letters, they could use bytestring_to_str(). (Yes,
> having all those routines for this is overkill.)
I'll take a look at it tonight and somewhat rewrite that loop (which is
currently O(n^2) and should be O(n) anyway).
Ciao
Joerg
--
Joerg Mayer <jmayer@xxxxxxxxx>
We are stuck with technology when what we really want is just stuff that
works. Some say that should read Microsoft instead of technology.