fix a couple of compiler warnings

This commit is contained in:
John Cupitt 2021-05-08 19:51:01 +01:00
parent a0e0c4e45b
commit 6d9308d93c
2 changed files with 5 additions and 1 deletions

View File

@ -279,8 +279,12 @@ vips_buf_appendns( VipsBuf *buf, const char *str, int sz )
/* Can't use vips_strncpy() here, we don't want to drop the end of the
* string.
*
* gcc10 issues a false-positive warning about this.
*/
#pragma GCC diagnostic push
strncpy( buf->base + buf->i, str, cpy );
#pragma GCC diagnostic pop
buf->i += cpy;
if( buf->i >= buf->mx - 4 ) {

View File

@ -613,7 +613,7 @@ vips__set_create_time( int fd )
SYSTEMTIME st;
FILETIME ft;
if( (handle = _get_osfhandle( fd )) == INVALID_HANDLE_VALUE )
if( (handle = (HANDLE) _get_osfhandle( fd )) == INVALID_HANDLE_VALUE )
return;
GetSystemTime( &st );
SystemTimeToFileTime( &st, &ft );