Disclaimer: I didn't check the code
But maybe the sizeof(buf) is right? - if you want the size of the pointer (maybe if you're using wide chars?)
Especially since it's an 'Error_message_buf' type
EDIT: probably not, I'm thinking of sizeof(buf[0]), sizeof(buf) makes even less sense, it's a bug unless someone has a very good reason for it
Amazing that the tool detects collections of similar blocks, it's not wrong per se, but it's a common source of copy-paste bugs.