mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-19 04:49:25 +08:00
Cygwin: utils: change 3rd readlink param to size_t
Avoid gcc warnings Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
parent
13909bc262
commit
37f4fea07c
@ -181,7 +181,7 @@ out:
|
|||||||
|
|
||||||
/* Assumes is_symlink(fh) is true */
|
/* Assumes is_symlink(fh) is true */
|
||||||
bool
|
bool
|
||||||
readlink (HANDLE fh, char *path, int maxlen)
|
readlink (HANDLE fh, char *path, size_t maxlen)
|
||||||
{
|
{
|
||||||
DWORD rv;
|
DWORD rv;
|
||||||
char *buf, *cp;
|
char *buf, *cp;
|
||||||
@ -225,7 +225,7 @@ readlink (HANDLE fh, char *path, int maxlen)
|
|||||||
return false;
|
return false;
|
||||||
wcstombs (path, (wchar_t *) (cp + 2), wlen + 1);
|
wcstombs (path, (wchar_t *) (cp + 2), wlen + 1);
|
||||||
}
|
}
|
||||||
else if (len + 1 > maxlen)
|
else if ((size_t) (len + 1) > maxlen)
|
||||||
return false;
|
return false;
|
||||||
else
|
else
|
||||||
memcpy (path, cp, len);
|
memcpy (path, cp, len);
|
||||||
@ -243,7 +243,7 @@ readlink (HANDLE fh, char *path, int maxlen)
|
|||||||
return false;
|
return false;
|
||||||
wcstombs (path, (wchar_t *) (cp + 2), wlen + 1);
|
wcstombs (path, (wchar_t *) (cp + 2), wlen + 1);
|
||||||
}
|
}
|
||||||
else if (fi.nFileSizeLow - strlen (SYMLINK_COOKIE) > (unsigned) maxlen)
|
else if (fi.nFileSizeLow - strlen (SYMLINK_COOKIE) > maxlen)
|
||||||
return false;
|
return false;
|
||||||
else
|
else
|
||||||
strcpy (path, cp);
|
strcpy (path, cp);
|
||||||
@ -778,7 +778,7 @@ rel_vconcat (const char *cwd, const char *s, va_list v)
|
|||||||
cwd = pathbuf;
|
cwd = pathbuf;
|
||||||
}
|
}
|
||||||
|
|
||||||
int max_len = 0;
|
size_t max_len = 0;
|
||||||
mnt_t *m, *match = NULL;
|
mnt_t *m, *match = NULL;
|
||||||
|
|
||||||
for (m = mount_table; m->posix; m++)
|
for (m = mount_table; m->posix; m++)
|
||||||
|
@ -17,7 +17,7 @@ char *cygpath (const char *s, ...);
|
|||||||
char *cygpath_rel (const char *cwd, const char *s, ...);
|
char *cygpath_rel (const char *cwd, const char *s, ...);
|
||||||
bool is_exe (HANDLE);
|
bool is_exe (HANDLE);
|
||||||
bool is_symlink (HANDLE);
|
bool is_symlink (HANDLE);
|
||||||
bool readlink (HANDLE, char *, int);
|
bool readlink (HANDLE, char *, size_t);
|
||||||
int get_word (HANDLE, int);
|
int get_word (HANDLE, int);
|
||||||
int get_dword (HANDLE, int);
|
int get_dword (HANDLE, int);
|
||||||
bool from_fstab_line (mnt_t *m, char *line, bool user);
|
bool from_fstab_line (mnt_t *m, char *line, bool user);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user