From 66ce00153bd35bb83a296f7eb31efec6d6e6768b Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Mon, 21 Jul 2014 22:56:37 +0200 Subject: Refactor new_tempfile() Avoid preallocating buffers on the stack, use dynamic memory allocation instead. Also, change the semantics of new_tempfile() so that it returns the full name of the temporary file and fix all call sites. Signed-off-by: Lukas Fleischer --- src/calcurse.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/calcurse.h') diff --git a/src/calcurse.h b/src/calcurse.h index 887e224..0fc3f62 100644 --- a/src/calcurse.h +++ b/src/calcurse.h @@ -117,7 +117,6 @@ #define STATUSHEIGHT 2 #define MAX_NOTESIZ 40 -#define TMPEXTSIZ 6 /* Format for appointment hours is: HH:MM */ #define HRMIN_SIZE 6 @@ -1032,7 +1031,7 @@ long now(void); char *nowstr(void); void print_bool_option_incolor(WINDOW *, unsigned, int, int); const char *get_tempdir(void); -char *new_tempfile(const char *, int); +char *new_tempfile(const char *); int check_date(unsigned, unsigned, unsigned); int parse_date(const char *, enum datefmt, int *, int *, int *, struct date *); -- cgit v1.2.3-54-g00ecf