Skip to content
Snippets Groups Projects
Commit 735de060 authored by rswindell's avatar rswindell
Browse files

Removed unused prototype (chardupe)

Added FREE_ALLOC macro (to free cfg buffers malloced with get_alloc).
Removed definition of SAVE_MEMORY (duplicate pointers make freeing difficult).
parent d28408c4
No related branches found
No related tags found
No related merge requests found
......@@ -38,7 +38,7 @@
#ifndef _SCFGLIB_H
#define _SCFGLIB_H
#define SAVE_MEMORY
/* #define SAVE_MEMORY /* This makes it difficult to free */
#define get_int(var,stream) { if(!fread(&var,1,sizeof(var),stream)) \
memset(&var,0,sizeof(var)); \
......@@ -49,6 +49,13 @@
#define FREE_AND_NULL(x) if(x!=NULL) { FREE(x); x=NULL; }
/* The FREE_ALLOC macro is used for get_alloc() buffers only */
#ifdef SCFG
#define FREE_ALLOC(x) /* static */
#else
#define FREE_ALLOC(x) if(x!=NULL && x!=scfgnulstr) { FREE(x); x=NULL; }
#endif
typedef struct {
char *openerr,
*reading,
......@@ -86,7 +93,6 @@ void free_chat_cfg(scfg_t* cfg);
long aftol(char *str); /* Converts flag string to long */
char *ltoaf(long l, char *str); /* Converts long to flag string */
char *faddrtoa(faddr_t addr); /* FidoNet address to ASCII text conversion */
char chardupe(char *str); /* Searches for duplicate chars in str */
uchar attrstr(char *str); /* Convert ATTR string into attribute int */
#ifdef __cplusplus
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment