aboutsummaryrefslogtreecommitdiff
path: root/lib/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/common.c')
-rw-r--r--lib/common.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/common.c b/lib/common.c
index 56f7fd1..f1eac05 100644
--- a/lib/common.c
+++ b/lib/common.c
@@ -117,3 +117,21 @@ tgeb_free_sd(SORTED * sd)
free(sd->data);
free(sd);
}
+
+char *
+tgeb_read_date(char *file)
+{
+ FILE *fd;
+ char *datum;
+
+ if (!(datum = calloc(20, sizeof(char))))
+ err(1, "malloc");;
+
+ if(!(fd = fopen(file, "r")))
+ err(1, "fopen %s", file);
+
+ fread(datum, sizeof(char), 19, fd);
+
+ fclose(fd);
+ return(datum);
+}