On Friday, 26 January 2018 10:36:11 UTC+2, Andrey Karpov wrote:
> We would like to suggest reading the series of articles dedicated to the recommendations on writing code of high quality using the examples of errors found in the Chromium project. This is the first part which will be devoted to the memset function.
High quality recommendation suggests to use *something*.
For example either std::array<WebUChar,kTextLengthCap> or
std::basic_string<WebUChar> instead of those raw fixed or
allocated with new arrays in C++ ... and decades old idioms
'memset(p, 0, length * sizeof *p);' in C.
But your article fails even to tell relation between
constant 'kTextLengthCap' and variable 'text_length_cap'
as in
WebUChar text[kTextLengthCap];
and
memset(key_event->text, 0, text_length_cap);
"High quality" indeed. :D