diff options
Diffstat (limited to 'zola/content/articles/safer-pointers.md')
-rw-r--r-- | zola/content/articles/safer-pointers.md | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/zola/content/articles/safer-pointers.md b/zola/content/articles/safer-pointers.md index 1a1b55e..d6fd418 100644 --- a/zola/content/articles/safer-pointers.md +++ b/zola/content/articles/safer-pointers.md @@ -14,10 +14,10 @@ Tags=["C", "Patterns", "Pointers"] Pointers are an important feature of C, but at the same time they are prone to error. To reduce errors, and make them safer to use, I propose the following 4 tips: -1. Encapsulating the *malloc()* and *free()* functions +1. Encapsulating the *malloc()* and *free()* functions. 2. Using *calloc()* in the new alloc function, and making the structure "fail-safe" when everything is zero. -3. Making the new *free* function set the freed pointer to *NULL* -4. Every time a pointer is passed to another function, deciding who *owns* the pointer +3. Making the new *free* function set the freed pointer to *NULL*. +4. Every time a pointer is passed to another function, deciding who *owns* the pointer. ### Example |