Rfc6810 bis

pull request for reviewing code
simplify: &((*result)[(*result_size-1)])
remove unnecessary braces and casts to make it more readable