Wouldn't this would exceed `maxlen`? 

Interestingly, I can't find any cal to `write_reg_contents_ex()` nor `write_reg_contents()` where `maxlen` is not `-1`.