Purely out of interest, and probably my bad, but what is:
(void)k_sz;
doing? I've seen fussy people doing: (void) printf( "hello" );
but not what you have written. As I say, probably ignorance on my part.