Fix warnings
FossilOrigin-Name: 47585409b5d56366a5d1a266f1157d55494d207b0912383979f2492107c39f7f
This commit is contained in:
parent
0809ee3cab
commit
c3ba1a94eb
4 changed files with 8 additions and 8 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2012, 2013, 2014, 2015, 2016, 2017
|
||||
* Copyright (c) 2012, 2013, 2014, 2015, 2016, 2017, 2024
|
||||
* Jonathan Schleifer <js@nil.im>
|
||||
*
|
||||
* https://fossil.nil.im/objpgsql
|
||||
|
@ -58,7 +58,7 @@
|
|||
|
||||
- (id)objectAtIndex: (size_t)index
|
||||
{
|
||||
if (index > PQntuples(_result))
|
||||
if (index > LONG_MAX || (long)index > PQntuples(_result))
|
||||
@throw [OFOutOfRangeException exception];
|
||||
|
||||
return [PGResultRow pg_rowWithResult: self row: (int)index];
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019
|
||||
* Copyright (c) 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2024
|
||||
* Jonathan Schleifer <js@nil.im>
|
||||
*
|
||||
* https://fossil.nil.im/objpgsql
|
||||
|
@ -58,7 +58,7 @@ convertType(PGresult *res, int column, OFString *string)
|
|||
int _row, _pos, _count;
|
||||
}
|
||||
|
||||
- initWithResult: (PGResult*)result row: (int)row;
|
||||
- (instancetype)initWithResult: (PGResult*)result row: (int)row;
|
||||
@end
|
||||
|
||||
@interface PGResultRowKeyEnumerator: PGResultRowEnumerator
|
||||
|
@ -143,7 +143,7 @@ convertType(PGresult *res, int column, OFString *string)
|
|||
state->extra[1] = PQnfields(_res);
|
||||
}
|
||||
|
||||
if (count > SIZE_MAX - state->state)
|
||||
if (count < 0 || (unsigned long)count > SIZE_MAX - state->state)
|
||||
@throw [OFOutOfRangeException exception];
|
||||
|
||||
if (state->state + count > state->extra[1])
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2012, 2013, 2014, 2015, 2016, 2017
|
||||
* Copyright (c) 2012, 2013, 2014, 2015, 2016, 2017, 2024
|
||||
* Jonathan Schleifer <js@nil.im>
|
||||
*
|
||||
* https://fossil.nil.im/objpgsql
|
||||
|
@ -32,7 +32,7 @@
|
|||
return [[[self alloc] initWithConnection: connection] autorelease];
|
||||
}
|
||||
|
||||
- initWithConnection: (PGConnection *)connection
|
||||
- (instancetype)initWithConnection: (PGConnection *)connection
|
||||
{
|
||||
self = [super init];
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue