From 095a05ec3ca6c874ce7df35cf6f1399c51a59be3 Mon Sep 17 00:00:00 2001 From: josch Date: Wed, 24 Sep 2014 21:16:41 +0200 Subject: [PATCH] check strftime return value --- mfshell/commands/folder.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mfshell/commands/folder.c b/mfshell/commands/folder.c index 4b8e349..9bc8478 100644 --- a/mfshell/commands/folder.c +++ b/mfshell/commands/folder.c @@ -100,14 +100,16 @@ int mfshell_cmd_folder(mfshell * mfshell, int argc, char *const argv[]) gmtime_r(&epoch, &tm); // print ISO-8601 date followed by 24-hour time ftime_ret = strftime(ftime, max_time_len, "%F %T", &tm); - printf(" %-15.15s %s\n\r", "epoch:", ftime); + if (ftime_ret != 0) + printf(" %-15.15s %s\n\r", "epoch:", ftime); } if (created != 0) { gmtime_r(&created, &tm); // print ISO-8601 date followed by 24-hour time ftime_ret = strftime(ftime, max_time_len, "%F %T", &tm); - printf(" %-15.15s %s\n\r", "created:", ftime); + if (ftime_ret != 0) + printf(" %-15.15s %s\n\r", "created:", ftime); } folder_free(folder);