summaryrefslogtreecommitdiff
path: root/source3/client/client.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/client/client.c')
-rw-r--r--source3/client/client.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/source3/client/client.c b/source3/client/client.c
index 1fbee70645..aa25d9aba5 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -379,7 +379,7 @@ static void display_finfo(file_info *finfo)
finfo->name,
attrib_string(finfo->mode),
(double)finfo->size,
- asctime(localtime(&t)));
+ time_to_asc(&t));
dir_total += finfo->size;
}
}
@@ -2111,6 +2111,7 @@ static int cmd_stat(void)
fstring mode_str;
SMB_STRUCT_STAT sbuf;
struct cli_state *targetcli;
+ struct tm *lt;
pstring targetname;
if (!SERVER_HAS_UNIX_CIFS(cli)) {
@@ -2165,13 +2166,28 @@ static int cmd_stat(void)
(unsigned int)sbuf.st_uid,
(unsigned int)sbuf.st_gid);
- strftime(mode_str, sizeof(mode_str), "%F %T %z", localtime(&sbuf.st_atime));
+ lt = localtime(&sbuf.st_atime);
+ if (lt) {
+ strftime(mode_str, sizeof(mode_str), "%F %T %z", lt);
+ } else {
+ fstrcpy(mode_str, "unknown");
+ }
d_printf("Access: %s\n", mode_str);
- strftime(mode_str, sizeof(mode_str), "%F %T %z", localtime(&sbuf.st_mtime));
+ lt = localtime(&sbuf.st_mtime);
+ if (lt) {
+ strftime(mode_str, sizeof(mode_str), "%F %T %z", lt);
+ } else {
+ fstrcpy(mode_str, "unknown");
+ }
d_printf("Modify: %s\n", mode_str);
- strftime(mode_str, sizeof(mode_str), "%F %T %z", localtime(&sbuf.st_ctime));
+ lt = localtime(&sbuf.st_ctime);
+ if (lt) {
+ strftime(mode_str, sizeof(mode_str), "%F %T %z", lt);
+ } else {
+ fstrcpy(mode_str, "unknown");
+ }
d_printf("Change: %s\n", mode_str);
return 0;
@@ -2339,7 +2355,7 @@ static int cmd_newer(void)
if (ok && (sys_stat(buf,&sbuf) == 0)) {
newer_than = sbuf.st_mtime;
DEBUG(1,("Getting files newer than %s",
- asctime(localtime(&newer_than))));
+ time_to_asc(&newer_than)));
} else {
newer_than = 0;
}