projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix strncpy(3) copy length
[fio.git]
/
os
/
windows
/
posix.c
diff --git
a/os/windows/posix.c
b/os/windows/posix.c
index eae8c86170b958254bd8a2bc14c7015f801ac8d7..00f03355985077c08665a79e5036b60755507e40 100755
(executable)
--- a/
os/windows/posix.c
+++ b/
os/windows/posix.c
@@
-25,8
+25,8
@@
#include "../os-windows.h"
#include "../../lib/hweight.h"
#include "../os-windows.h"
#include "../../lib/hweight.h"
-extern unsigned long mtime_since_now(struct time
val
*);
-extern void fio_gettime(struct time
val
*, void *);
+extern unsigned long mtime_since_now(struct time
spec
*);
+extern void fio_gettime(struct time
spec
*, void *);
/* These aren't defined in the MinGW headers */
HRESULT WINAPI StringCchCopyA(
/* These aren't defined in the MinGW headers */
HRESULT WINAPI StringCchCopyA(
@@
-584,7
+584,8
@@
char *basename(char *path)
while (path[i] != '\\' && path[i] != '/' && i >= 0)
i--;
while (path[i] != '\\' && path[i] != '/' && i >= 0)
i--;
- strncpy(name, path + i + 1, MAX_PATH);
+ name[MAX_PATH - 1] = '\0';
+ strncpy(name, path + i + 1, MAX_PATH - 1);
return name;
}
return name;
}
@@
-852,7
+853,7
@@
int poll(struct pollfd fds[], nfds_t nfds, int timeout)
int nanosleep(const struct timespec *rqtp, struct timespec *rmtp)
{
int nanosleep(const struct timespec *rqtp, struct timespec *rmtp)
{
- struct time
val
tv;
+ struct time
spec
tv;
DWORD ms_remaining;
DWORD ms_total = (rqtp->tv_sec * 1000) + (rqtp->tv_nsec / 1000000.0);
DWORD ms_remaining;
DWORD ms_total = (rqtp->tv_sec * 1000) + (rqtp->tv_nsec / 1000000.0);