projects
/
pspp
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
78a43b3
)
spv-writer: Avoid obsolete function asctime().
author
Ben Pfaff
<blp@cs.stanford.edu>
Sun, 7 Feb 2021 04:13:19 +0000
(20:13 -0800)
committer
Ben Pfaff
<blp@cs.stanford.edu>
Sun, 7 Feb 2021 04:13:19 +0000
(20:13 -0800)
Found by cppcheck.
Reported by John Darrington.
src/output/spv/spv-writer.c
patch
|
blob
|
history
diff --git
a/src/output/spv/spv-writer.c
b/src/output/spv/spv-writer.c
index f1f9b969563f7fab49cf785ae01b19b621212035..549a0d8f849839b01d4fd3907fd8214048ff2746 100644
(file)
--- a/
src/output/spv/spv-writer.c
+++ b/
src/output/spv/spv-writer.c
@@
-194,8
+194,9
@@
spv_writer_open_file (struct spv_writer *w)
time_t t = time (NULL);
struct tm *tm = gmtime (&t);
- char *tm_s = asctime (tm);
- write_attr (w, "creation-date-time", tm_s);
+ char tm_s[128];
+ if (strftime (tm_s, sizeof tm_s, "%x %X", tm))
+ write_attr (w, "creation-date-time", tm_s);
write_attr (w, "creator", version);