commit b23f4366a80979ac9f7dd9da3a4789d814ed721f
parent 4efcacb0b566d74ba6f5c64064e67aa24968e36f
Author: Claudio Alessi <smoppy@gmail.com>
Date: Fri, 9 Mar 2018 22:03:57 +0100
Better name for the string-to-timestamp function.
Diffstat:
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/sw.1 b/sw.1
@@ -0,0 +1 @@
+
diff --git a/sw.c b/sw.c
@@ -32,7 +32,7 @@ void loadmovs(void);
void savemovs(void);
void showmovs(void);
void sortmovs(void);
-int strfts(char *s);
+int strtots(char *s);
void usage(void);
/* variables */
@@ -52,7 +52,7 @@ addmov(char *date, float amount, char *note) {
++id;
m = ecalloc(1, sizeof(Movement));
m->id = id;
- m->ts = strfts(date);
+ m->ts = strtots(date);
m->amount = amount;
memcpy(m->note, note, sizeof(m->note));
m->note[ sizeof(m->note) - 1] = '\0';
@@ -195,7 +195,7 @@ sortmovs(void) {
}
int
-strfts(char *s) {
+strtots(char *s) {
struct tm tm = {0};
if(!strcmp(s, "now"))