On 3/31/11, Jesse Phillips <jessekphillip...@gmail.com> wrote: > Why not: > > string getNameOld() > { > static char[256] name; > cDispatch(name.ptr, kGetProductName); > return to!string(name.ptr); > } >
Nice catch! But see my second reply. If a null terminator is missing and we know we're operating on a D array (which has a length), then it could be best to check for a null terminator. If there isn't one it is highly likely that the array contains garbage.