From d636a1bc5fb10db062f022bf1a9a2b9b62e287e7 Mon Sep 17 00:00:00 2001 From: beinhaerter <34543625+beinhaerter@users.noreply.github.com> Date: Thu, 1 Aug 2019 20:24:18 +0200 Subject: [PATCH] section_sl, different stuff (#1487) - typo "a" -> "as" - added "???" to mark incomplete sentence - typo "than" -> "that" - "scanf using s" -> "scanf using %s" (same as for printf) - added missing comma --- CppCoreGuidelines.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index 82dea2a..39fcf71 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -19222,7 +19222,7 @@ People working with code for which that difference matters are quite capable of Usually you need to add and remove elements from the container, so use `vector` by default; if you don't need to modify the container's size, use `array`. -Even when other containers seem more suited, such a `map` for O(log N) lookup performance or a `list` for efficient insertion in the middle, a `vector` will usually still perform better for containers up to a few KB in size. +Even when other containers seem more suited, such as `map` for O(log N) lookup performance or a `list` for efficient insertion in the middle, a `vector` will usually still perform better for containers up to a few KB in size. ##### Note @@ -19341,7 +19341,7 @@ The important issue of non-ASCII character sets and encodings (e.g., `wchar_t`, **See also**: [regular expressions](#SS-regex) Here, we use "sequence of characters" or "string" to refer to a sequence of characters meant to be read as text (somehow, eventually). -We don't consider +We don't consider ??? String summary: @@ -19423,7 +19423,7 @@ Will this code pass a security review? ##### Note -Do not assume that `string` is slower than lower-level techniques without measurement and remember than not all code is performance critical. +Do not assume that `string` is slower than lower-level techniques without measurement and remember that not all code is performance critical. [Don't optimize prematurely](#Rper-Knuth) ##### Enforcement @@ -19698,7 +19698,7 @@ implicit memory management, and `locale` handling. If you need I/O performance, you can almost always do better than `printf()`. -`gets()` `scanf()` using `s`, and `printf()` using `%s` are security hazards (vulnerable to buffer overflow and generally error-prone). +`gets()`, `scanf()` using `%s`, and `printf()` using `%s` are security hazards (vulnerable to buffer overflow and generally error-prone). In C11, they are replaced by `gets_s()`, `scanf_s()`, and `printf_s()` as safer alternatives, but they are still not type safe. ##### Enforcement