From 6ae7fadb9257ba44cd4524cc7cf8780258d0a1c0 Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Thu, 13 Sep 2001 20:18:01 +0000
Subject: [PATCH] Updated FREE_AR macro: now nulls variable and works with .cpp
 files.

---
 src/sbbs3/scfglib.h | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/src/sbbs3/scfglib.h b/src/sbbs3/scfglib.h
index 2a9ec267e6..146a5985df 100644
--- a/src/sbbs3/scfglib.h
+++ b/src/sbbs3/scfglib.h
@@ -47,16 +47,17 @@
 								memset(var,0,sizeof(var)); \
                               offset+=sizeof(var); }
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 extern const char*	scfgnulstr;
 extern const uchar* nular;
 
 #define FREE_AND_NULL(x) if(x!=NULL) { FREE(x); x=NULL; }
 
-#ifdef SCFG
-#define FREE_AR(x)		/* static */
-#else
-#define FREE_AR(x)		if(x!=NULL && x!=nular)	{ FREE(x); }		/* allocated with arstr() */	
-#endif
+/* allocated with arstr() */	
+#define FREE_AR(x)		if(x!=NULL && x!=nular)	{ FREE(x); x=NULL; }	
 
 typedef struct {
     char    *openerr,
@@ -66,10 +67,6 @@ typedef struct {
             *error;
             } read_cfg_text_t;
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 char*	get_alloc(long *offset, char *outstr, int maxlen, FILE *instream);
 BOOL	allocerr(read_cfg_text_t* txt, long offset, char *fname, uint size);
 char*	readline(long *offset, char *str, int maxlen, FILE *stream);
-- 
GitLab