summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kilo.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/kilo.c b/kilo.c
index 1be0fac..4b1d89b 100644
--- a/kilo.c
+++ b/kilo.c
@@ -34,8 +34,7 @@
#define KILO_VERSION "0.0.1"
-#define _BSD_SOURCE
-#define _GNU_SOURCE
+#define _POSIX_C_SOURCE 200809L
#include <termios.h>
#include <stdlib.h>
@@ -43,6 +42,7 @@
#include <errno.h>
#include <string.h>
#include <ctype.h>
+#include <time.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/time.h>
@@ -997,6 +997,7 @@ void editorFind(int fd) {
#define FIND_RESTORE_HL do { \
if (saved_hl) { \
memcpy(E.row[saved_hl_line].hl,saved_hl, E.row[saved_hl_line].rsize); \
+ free(saved_hl); \
saved_hl = NULL; \
} \
} while (0)