From: Michael Meskes Date: Thu, 21 May 2009 12:54:27 +0000 (+0000) Subject: Removed comparison of unsigned expression < 0. X-Git-Url: http://git.postgresql.org/gitweb/static/developers.postgresql.org?a=commitdiff_plain;h=64b2da3f7778bc6fd3d213ceb9e73ff3b6e03890;p=users%2Fsimon%2Fpostgres.git Removed comparison of unsigned expression < 0. --- diff --git a/src/backend/utils/adt/tsvector.c b/src/backend/utils/adt/tsvector.c index 478f9dba84..e7a20d5b70 100644 --- a/src/backend/utils/adt/tsvector.c +++ b/src/backend/utils/adt/tsvector.c @@ -475,7 +475,7 @@ tsvectorrecv(PG_FUNCTION_ARGS) /* sanity checks */ lex_len = strlen(lexeme); - if (lex_len < 0 || lex_len > MAXSTRLEN) + if (lex_len > MAXSTRLEN) elog(ERROR, "invalid tsvector: lexeme too long"); if (datalen > MAXSTRPOS) diff --git a/src/interfaces/libpq/fe-exec.c b/src/interfaces/libpq/fe-exec.c index c1934ad643..5990fb7c1c 100644 --- a/src/interfaces/libpq/fe-exec.c +++ b/src/interfaces/libpq/fe-exec.c @@ -2385,7 +2385,7 @@ PQresultStatus(const PGresult *res) char * PQresStatus(ExecStatusType status) { - if (status < 0 || status >= sizeof pgresStatus / sizeof pgresStatus[0]) + if (status >= sizeof pgresStatus / sizeof pgresStatus[0]) return libpq_gettext("invalid ExecStatusType code"); return pgresStatus[status]; } diff --git a/src/interfaces/libpq/fe-misc.c b/src/interfaces/libpq/fe-misc.c index 32479cf716..21ddff41c4 100644 --- a/src/interfaces/libpq/fe-misc.c +++ b/src/interfaces/libpq/fe-misc.c @@ -178,7 +178,7 @@ pqPuts(const char *s, PGconn *conn) int pqGetnchar(char *s, size_t len, PGconn *conn) { - if (len < 0 || len > (size_t) (conn->inEnd - conn->inCursor)) + if (len > (size_t) (conn->inEnd - conn->inCursor)) return EOF; memcpy(s, conn->inBuffer + conn->inCursor, len);