datetime: Add error message
This commit is contained in:
parent
ee5ec75621
commit
932f65c373
@ -10,6 +10,7 @@ datetime(const char *fmt)
|
|||||||
|
|
||||||
t = time(NULL);
|
t = time(NULL);
|
||||||
if (!strftime(buf, sizeof(buf), fmt, localtime(&t))) {
|
if (!strftime(buf, sizeof(buf), fmt, localtime(&t))) {
|
||||||
|
fprintf(stderr, "strftime: Result string exceeds buffer size\n");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user