Removed the return variable 'ret' from sprintf. The sprintf returns the number of characters written, but in this case it's just 1.
And this change corrects the compilation failure.
Replacing the argument to sizeof so that the compiler stops complaining. It was sized exactly like the above function.