]> granicus.if.org Git - postgresql/commitdiff
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 4007c8c5062c1ee5c4006d3c3bd270fcc4c62071..ba2fef94aad8870e72a93ada155a91f543cf9999 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/utils/adt/tsvector.c,v 1.15 2009/01/01 17:23:50 momjian Exp $
+ *       $PostgreSQL: pgsql/src/backend/utils/adt/tsvector.c,v 1.16 2009/05/21 12:54:27 meskes Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -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 c3898f78b446a8afdad689e5aea04f016dbd33a3..a73630191b1940ee4f32a035d0820b42650e31b3 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/interfaces/libpq/fe-exec.c,v 1.200 2009/01/01 17:24:03 momjian Exp $
+ *       $PostgreSQL: pgsql/src/interfaces/libpq/fe-exec.c,v 1.201 2009/05/21 12:54:27 meskes Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -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 fe1101bed9d31e2bc9af5d0f0c07652611cf33d0..60459cb7e1c3208356bdc99fe3c4baa78000f559 100644 (file)
@@ -23,7 +23,7 @@
  * Portions Copyright (c) 1994, Regents of the University of California
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/interfaces/libpq/fe-misc.c,v 1.138 2009/01/01 17:24:03 momjian Exp $
+ *       $PostgreSQL: pgsql/src/interfaces/libpq/fe-misc.c,v 1.139 2009/05/21 12:54:27 meskes Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -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);