fix: possible NULL pointer dereferencement
fix: not enough room to store the canary in longopt_buf