[Tellico] Export to PilotDB broken?

Robby Stephenson robby at periapsis.org
Tue Feb 20 19:40:00 MST 2007


On Tuesday 20 February 2007, Jens Seidel wrote:
> The following patch fixes it but I'm not sure whether it caused any
> problem except reading bogus data which is probably ignored:
>
> -  memcpy(buf, name().c_str(), 32);
> +  for (int i=0; i<32; ++i)
> +    buf[i] = 0;
> +  memcpy(buf, name().c_str(), std::min(32-1,
> static_cast<int>(name().length()))); set_short(buf + 32, flags());
>    set_short(buf + 34, version());
>    set_long(buf + 36, creation_time());
>
> (I'm not sure whether the beginning of buf needs to be a null terminated
> character string, that's why I subtract 1 to ensure it.)

Most of the code in the PilotDB wrapper is taken from the pilotdb source 
itself, so I'm not very familiar with it. I replaced some of the buffers 
with QBuffer, etc, which is about all.

Your quick patch looks fine, thanks for taking such a detailed look. Do you 
have a Palm to test it against?

Thanks!
Robby



More information about the tellico-users mailing list