Conversion functions take buflen to prevent buffer overflows