From f9d637e7be727e9bc750f22e0c359f468a098a90 Mon Sep 17 00:00:00 2001 From: Jonathan Schleifer Date: Sun, 6 Sep 2015 16:17:10 +0000 Subject: [PATCH] Adjust to ObjFW changes FossilOrigin-Name: 8af0a7a7662306b2875fc35b6656b24794e624be5b995b2b42fa88a2bac0a220 --- src/PGResultRow.m | 9 +++++++-- src/exceptions/PGException.m | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/PGResultRow.m b/src/PGResultRow.m index 60b7d47..089ebfc 100644 --- a/src/PGResultRow.m +++ b/src/PGResultRow.m @@ -191,6 +191,8 @@ convertType(PGresult *res, int column, OFString *string) @implementation PGResultRowObjectEnumerator - (id)nextObject { + id object; + if (_pos >= _count) return nil; @@ -200,7 +202,10 @@ convertType(PGresult *res, int column, OFString *string) if (_pos >= _count) return nil; - return convertType(_res, _pos, - [OFString stringWithUTF8String: PQgetvalue(_res, _row, _pos++)]); + object = convertType(_res, _pos, + [OFString stringWithUTF8String: PQgetvalue(_res, _row, _pos)]); + _pos++; + + return object; } @end diff --git a/src/exceptions/PGException.m b/src/exceptions/PGException.m index b21bed6..00bcc89 100644 --- a/src/exceptions/PGException.m +++ b/src/exceptions/PGException.m @@ -14,7 +14,7 @@ _connection = [connection retain]; _error = [[OFString alloc] initWithCString: PQerrorMessage([_connection PG_connection]) - encoding: [OFString nativeOSEncoding]]; + encoding: [OFSystemInfo native8BitEncoding]]; } @catch (id e) { [self release]; @throw e;