From 63d776b9d6afd037bd115dc365b2dffd5e699991 Mon Sep 17 00:00:00 2001 From: Nicolas Dato Date: Wed, 26 Mar 2025 15:14:00 -0300 Subject: new article, using typedef or not --- zola/content/articles/safer-pointers.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'zola/content/articles/safer-pointers.md') 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 -- cgit v1.2.3