aboutsummaryrefslogtreecommitdiffstats
path: root/csrc
diff options
context:
space:
mode:
Diffstat (limited to 'csrc')
-rw-r--r--csrc/smith.c9
-rw-r--r--csrc/smith.h2
2 files changed, 8 insertions, 3 deletions
diff --git a/csrc/smith.c b/csrc/smith.c
index 5ac1e73..3643abd 100644
--- a/csrc/smith.c
+++ b/csrc/smith.c
@@ -8,6 +8,8 @@
#include "smith.h"
#include <sys/time.h>
+#include <stdio.h>
+#include <stdlib.h>
char *
mr_smith()
@@ -15,13 +17,16 @@ mr_smith()
return ("---SMITH_V0.0.0---");
}
-long
+char*
get_timestamp()
{
struct timeval tv;
long ct;
+ char * buffer;
+ buffer = (char*)malloc(30);
gettimeofday(&tv, NULL);
ct = ((tv.tv_sec * 1000) + (tv.tv_usec / 1000));
- return (ct);
+ sprintf(buffer, "%ld", ct);
+ return buffer;
}
diff --git a/csrc/smith.h b/csrc/smith.h
index e9bbdbb..3baebf2 100644
--- a/csrc/smith.h
+++ b/csrc/smith.h
@@ -12,6 +12,6 @@
#include <unistd.h>
char * mr_smith();
-long get_timestamp();
+char * get_timestamp();
#endif // SMITH_H_