#14 Fix typos spotted by codespell
Merged 3 years ago by huzaifas. Opened 3 years ago by ueno.
ueno/defensive-coding-guide wip/dueno/typo  into  master

@@ -135,7 +135,7 @@ 

  that contains the requested keys to do the crypto operations. As long as

  the application opens an NSS database and properly sets a pin callback. If

  it runs with native NSS, it should be able to use HSMs that provide PKCS #11

- modules. Modules can also be loaded programatically, though this is less common.

+ modules. Modules can also be loaded programmatically, though this is less common.

  

  The following example demonstrates a typical NSS application for signing.

  

@@ -33,7 +33,7 @@ 

  Always keep track of the size of the array you are working with.

  Often, code is more obviously correct when you keep a pointer

  past the last element of the array, and calculate the number of

- remaining elements by substracting the current position from

+ remaining elements by subtracting the current position from

  that pointer. The alternative, updating a separate variable

  every time when the position is advanced, is usually less

  obviously correct.

@@ -194,7 +194,7 @@ 

  `java.lang.Throwable`, but not from

  `java.lang.Exception`.

  

- The general expection is that run-time errors are avoided by

+ The general exception is that run-time errors are avoided by

  careful programming (e.g., not dividing by zero). Checked

  exception are expected to be caught as they happen (e.g., when

  an input file is unexpectedly missing). Errors are impossible
@@ -237,7 +237,7 @@ 

  

  It is usually necessary to log errors. Otherwise, no trace of

  the problem might be left anywhere, making it very difficult

- to diagnose realted failures. Consequently, if you catch

+ to diagnose related failures. Consequently, if you catch

  `java.lang.Exception` to log and suppress all

  unexpected exceptions (for example, in a request dispatching

  loop), you should consider switching to

@@ -83,7 +83,7 @@ 

  

  In any case, classes referring to native resources must be

  declared `final`, and must not be serializeable

- or cloneable. Initialization and mutation of the state used by

+ or clonable. Initialization and mutation of the state used by

  the native side must be controlled carefully. Otherwise, it

  might be possible to create an object with inconsistent native

  state which results in a crash (or worse) when used (or perhaps

@@ -120,7 +120,7 @@ 

  It was introduced in Linux kernel 3.17, but before glibc 2.25 no API wrappers were

  provided. As such one could only use it via the syscall interface

  as `syscall(SYS_getrandom, (void*)dest, (size_t)size, (unsigned int)0)`.

- For portable code targetting multiple kernel versions one has to check 

+ For portable code targeting multiple kernel versions one has to check

  for the function beingavailable on run-time, and switch to another

  facility if the running kernel does not support this call.

  

@@ -48,7 +48,7 @@ 

  descriptors, descriptors are reused very quickly. Unless

  descriptor closing and other operations on the same file

  descriptor are synchronized (typically, using a mutex), there

- will be race conditons and I/O operations will be applied to

+ will be race conditions and I/O operations will be applied to

  the wrong file descriptor.

  

  Sometimes, it is necessary to close a file descriptor

@@ -212,7 +212,7 @@ 

  	    

  ----

  

- * In an entity defintion:

+ * In an entity definition:

  +

  [source,xml]

  ----