aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/adaint.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c
index 2a193ef..bb4ed26 100644
--- a/gcc/ada/adaint.c
+++ b/gcc/ada/adaint.c
@@ -1507,7 +1507,16 @@ extern long long __gnat_file_time(char* name)
long long ll_time;
} t_write;
- if (!GetFileAttributesExA(name, GetFileExInfoStandard, &fad)) {
+ TCHAR wname [GNAT_MAX_PATH_LEN + 2];
+ int name_len;
+
+ S2WSC (wname, name, GNAT_MAX_PATH_LEN + 2);
+ name_len = _tcslen (wname);
+
+ if (name_len > GNAT_MAX_PATH_LEN)
+ return LLONG_MIN;
+
+ if (!GetFileAttributesEx(wname, GetFileExInfoStandard, &fad)) {
return LLONG_MIN;
}