Skip to content

Commit ab9981c

Browse files
author
Michael Meskes
committed
Removed comparison of unsigned expression < 0.
1 parent c697337 commit ab9981c

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/backend/utils/adt/tsvector.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $PostgreSQL: pgsql/src/backend/utils/adt/tsvector.c,v 1.15 2009/01/01 17:23:50 momjian Exp $
10+
* $PostgreSQL: pgsql/src/backend/utils/adt/tsvector.c,v 1.16 2009/05/21 12:54:27 meskes Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -475,7 +475,7 @@ tsvectorrecv(PG_FUNCTION_ARGS)
475475
/* sanity checks */
476476

477477
lex_len = strlen(lexeme);
478-
if (lex_len < 0 || lex_len > MAXSTRLEN)
478+
if (lex_len > MAXSTRLEN)
479479
elog(ERROR, "invalid tsvector: lexeme too long");
480480

481481
if (datalen > MAXSTRPOS)

src/interfaces/libpq/fe-exec.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-exec.c,v 1.200 2009/01/01 17:24:03 momjian Exp $
11+
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-exec.c,v 1.201 2009/05/21 12:54:27 meskes Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -2385,7 +2385,7 @@ PQresultStatus(const PGresult *res)
23852385
char *
23862386
PQresStatus(ExecStatusType status)
23872387
{
2388-
if (status < 0 || status >= sizeof pgresStatus / sizeof pgresStatus[0])
2388+
if (status >= sizeof pgresStatus / sizeof pgresStatus[0])
23892389
return libpq_gettext("invalid ExecStatusType code");
23902390
return pgresStatus[status];
23912391
}

src/interfaces/libpq/fe-misc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
* Portions Copyright (c) 1994, Regents of the University of California
2424
*
2525
* IDENTIFICATION
26-
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-misc.c,v 1.138 2009/01/01 17:24:03 momjian Exp $
26+
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-misc.c,v 1.139 2009/05/21 12:54:27 meskes Exp $
2727
*
2828
*-------------------------------------------------------------------------
2929
*/
@@ -178,7 +178,7 @@ pqPuts(const char *s, PGconn *conn)
178178
int
179179
pqGetnchar(char *s, size_t len, PGconn *conn)
180180
{
181-
if (len < 0 || len > (size_t) (conn->inEnd - conn->inCursor))
181+
if (len > (size_t) (conn->inEnd - conn->inCursor))
182182
return EOF;
183183

184184
memcpy(s, conn->inBuffer + conn->inCursor, len);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy