> > std::unique_ptr<char[]> buf (new char[len+1]); > > char *str_to_check = buf.get (); > > + memset(str_to_check + len, 0, 1); > > aka. str_to_check[len] = '\0' It seems more readable. I'll resend the patch. Thanks.
- [PATCH] RISC-V: Fix a non null-terminated string. Kuan-Lin Chen
- Re: [PATCH] RISC-V: Fix a non null-terminated string. Kito Cheng
- Re: [PATCH] RISC-V: Fix a non null-terminated string. Andreas Schwab
- Re: [PATCH] RISC-V: Fix a non null-terminated stri... KuanLin Chen
- Re: [PATCH] RISC-V: Fix a non null-terminated string. Jeff Law
