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;