it won't work in all cases...
I think it's pretty clean having bool return (error/successful), and a parameter (error number if not successful, or usually the buffer index if successful)