No need to memset(buffer, 0, CF_MAXVARSIZE); buffer really doesn't need initialized at all !