Removed comparison of unsigned expression < 0.
authorMichael Meskes <meskes@postgresql.org>
Thu, 21 May 2009 12:54:27 +0000 (12:54 +0000)
committerMichael Meskes <meskes@postgresql.org>
Thu, 21 May 2009 12:54:27 +0000 (12:54 +0000)
src/backend/utils/adt/tsvector.c
src/interfaces/libpq/fe-exec.c
src/interfaces/libpq/fe-misc.c

index 478f9dba84ba22ead033257588b7b82458b226df..e7a20d5b70b67a738bad50a6f5e1516fca54a447 100644 (file)
@@ -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)
index c1934ad643090f5f6f8a012969b6f9a9fe67d1c9..5990fb7c1cab25568893814efd75016acac328ee 100644 (file)
@@ -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];
 }
index 32479cf716ef25c0ce69cdb79755ae0c51601f99..21ddff41c47f7a434e5028258fa7a6e021b5292a 100644 (file)
@@ -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);