summaryrefslogtreecommitdiff
path: root/ctime.c
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2010-11-09 14:42:19 +0000
committerIan C <ianc@noddybox.co.uk>2010-11-09 14:42:19 +0000
commit09f8544a57a09029d74c97c6da24087532a92080 (patch)
treeeac666faeabb7cf244aecee37d3c39fa20b0538d /ctime.c
parent4ba9cc5bf35ec57c5d684a290b603488ca699e7d (diff)
Tidied up ctime.c
Diffstat (limited to 'ctime.c')
-rw-r--r--ctime.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/ctime.c b/ctime.c
index 5ee8451..437218f 100644
--- a/ctime.c
+++ b/ctime.c
@@ -7,11 +7,15 @@ int main(int argc, char *argv[])
time_t t;
if (argc>1)
- t=(time_t)strtol(argv[1],NULL,0);
+ {
+ t = (time_t)strtoll(argv[1],NULL,0);
+ }
else
- t=time(NULL);
+ {
+ t = time(NULL);
+ }
- printf("%s",ctime(&t));
+ printf("%lld = %s",(long long)t, ctime(&t));
return 0;
}