summaryrefslogtreecommitdiff
path: root/src/vars.c
diff options
context:
space:
mode:
authorFrederic Culot <calcurse@culot.org>2008-12-28 13:13:58 +0000
committerFrederic Culot <calcurse@culot.org>2008-12-28 13:13:58 +0000
commit5352496984d550bd441b12a082d5a382c168cbe2 (patch)
tree8a61b0785ba0d2f9edde566bef372360244949e3 /src/vars.c
parenta63c74892085e6bd5ea8b88712f44d1567ce7ed3 (diff)
downloadcalcurse-5352496984d550bd441b12a082d5a382c168cbe2.zip
Added wrappers around libc's memory management functions, to easily debug memory usage
Diffstat (limited to 'src/vars.c')
-rwxr-xr-xsrc/vars.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/vars.c b/src/vars.c
index 3931729..8a80e09 100755
--- a/src/vars.c
+++ b/src/vars.c
@@ -1,4 +1,4 @@
-/* $calcurse: vars.c,v 1.11 2008/11/16 17:42:53 culot Exp $ */
+/* $calcurse: vars.c,v 1.12 2008/12/28 13:13:59 culot Exp $ */
/*
* Calcurse - text-based organizer
@@ -32,6 +32,7 @@
#include "custom.h"
#include "wins.h"
#include "keys.h"
+#include "mem.h"
#include "vars.h"
/*
@@ -112,7 +113,7 @@ vars_init (conf_t *conf)
conf->auto_save = true;
conf->skip_system_dialogs = false;
conf->skip_progress_bar = false;
- strncpy (conf->output_datefmt, "%D", 3);
+ (void)strncpy (conf->output_datefmt, "%D", 3);
conf->input_datefmt = 1;
/* Default external editor and pager */
@@ -133,7 +134,7 @@ vars_init (conf_t *conf)
calendar_set_first_day_of_week (MONDAY);
/* Pad structure to scroll text inside the appointment panel */
- apad = (struct pad_s *) malloc (sizeof (struct pad_s));
+ apad = (struct pad_s *) mem_malloc (sizeof (struct pad_s));
apad->length = 1;
apad->first_onscreen = 0;
@@ -143,3 +144,9 @@ vars_init (conf_t *conf)
/* Start at the current date */
calendar_init_slctd_day ();
}
+
+void
+vars_free (void)
+{
+ mem_free (apad);
+}