Use something like:
    
    
    var
      errBuf = newStringOfCap(256)
      retCode = do_something(..., errBuf.cstring)
    if retCode < 0:
      # if the API doesn't tell us about the size ... but it really should!
      errBuf.setLen(len(cstring(errBuf))
      echo "ERROR: ", errBuf
    

Reply via email to