disp_buf and disp_len are pointless. Some work is done to fill them in, but the result is never used. (If add code to use the results, I would recommend that their scopes be shrunk.)