No longer report an error for empty format strings
This commit is contained in:
parent
ea8d4d36bb
commit
3aa9992bf7
|
@ -41,7 +41,7 @@ static int _date(char const * format)
|
||||||
return -_date_error("time", 1);
|
return -_date_error("time", 1);
|
||||||
if(localtime_r(&t, &tm) == NULL)
|
if(localtime_r(&t, &tm) == NULL)
|
||||||
return -_date_error("localtime_r", 1);
|
return -_date_error("localtime_r", 1);
|
||||||
if(strftime(buf, sizeof(buf), format, &tm) == 0)
|
if(strftime(buf, sizeof(buf), format, &tm) == 0 && format[0] != '\0')
|
||||||
return -_date_error("strftime", 1);
|
return -_date_error("strftime", 1);
|
||||||
puts(buf);
|
puts(buf);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user