Merge branch 'js/ming-strftime'
* js/ming-strftime: mingw: abort on invalid strftime formats
This commit is contained in:
commit
4c5dbf1c14
@ -761,6 +761,17 @@ revert_attrs:
|
||||
return rc;
|
||||
}
|
||||
|
||||
#undef strftime
|
||||
size_t mingw_strftime(char *s, size_t max,
|
||||
const char *format, const struct tm *tm)
|
||||
{
|
||||
size_t ret = strftime(s, max, format, tm);
|
||||
|
||||
if (!ret && errno == EINVAL)
|
||||
die("invalid strftime format: '%s'", format);
|
||||
return ret;
|
||||
}
|
||||
|
||||
unsigned int sleep (unsigned int seconds)
|
||||
{
|
||||
Sleep(seconds*1000);
|
||||
|
@ -361,6 +361,9 @@ int mingw_fstat(int fd, struct stat *buf);
|
||||
|
||||
int mingw_utime(const char *file_name, const struct utimbuf *times);
|
||||
#define utime mingw_utime
|
||||
size_t mingw_strftime(char *s, size_t max,
|
||||
const char *format, const struct tm *tm);
|
||||
#define strftime mingw_strftime
|
||||
|
||||
pid_t mingw_spawnvpe(const char *cmd, const char **argv, char **env,
|
||||
const char *dir,
|
||||
|
Loading…
Reference in New Issue
Block a user