Really check the buf correctly

Thank you, Josh.

Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>