summaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c33
1 files changed, 3 insertions, 30 deletions
diff --git a/src/main.c b/src/main.c
index f450281..19b5334 100644
--- a/src/main.c
+++ b/src/main.c
@@ -92,49 +92,22 @@ _list_formats(void)
tm = localtime(&tim);
puts("Time formats:");
- out = NULL;
- out_sz = 0;
- buf = NULL;
- i = 0;
+ i = 0;
while (datetime_strftime_time(tm, &out, &out_sz, &buf, &i) > 0) {
printf(" * %s\n", out);
}
- if (out != NULL) {
- free(out);
- }
- if (buf != NULL) {
- free(buf);
- }
puts("Date formats:");
- out = NULL;
- out_sz = 0;
- buf = NULL;
- i = 0;
+ i = 0;
while (datetime_strftime_date(tm, &out, &out_sz, &buf, &i) > 0) {
printf(" * %s\n", out);
}
- if (out != NULL) {
- free(out);
- }
- if (buf != NULL) {
- free(buf);
- }
puts("Additional formats:");
- out = NULL;
- out_sz = 0;
- buf = NULL;
- i = 0;
+ i = 0;
while (datetime_strftime_misc(tm, &out, &out_sz, &buf, &i) > 0) {
printf(" * %s\n", out);
}
- if (out != NULL) {
- free(out);
- }
- if (buf != NULL) {
- free(buf);
- }
}
static void