## asdkGetLastError should write a null-terminated string but
## doesn't seem like it (at least CannotOpenCfg does not ends in
## null) so we empty the buffer ourselves before using it. Note
## that even when there are no errors, we need to empty the buffer
## because the buffer has the message 'No error in stack'.