]> granicus.if.org Git - postgresql/commitdiff
Correct ancient logic mistake in assertion
authorPeter Eisentraut <peter_e@gmx.net>
Tue, 6 Sep 2011 20:05:02 +0000 (23:05 +0300)
committerPeter Eisentraut <peter_e@gmx.net>
Tue, 6 Sep 2011 20:05:02 +0000 (23:05 +0300)
Found by gcc -Wlogical-op

src/backend/bootstrap/bootstrap.c

index baea46c0a89bb58187a6db9d970b0ac259aecfe4..e3dd472832eff616465be99200a8369d75ad7966 100644 (file)
@@ -817,7 +817,7 @@ InsertOneValue(char *value, int i)
        Oid                     typoutput;
        char       *prt;
 
-       AssertArg(i >= 0 || i < MAXATTR);
+       AssertArg(i >= 0 && i < MAXATTR);
 
        elog(DEBUG4, "inserting column %d value \"%s\"", i, value);
 
@@ -842,7 +842,7 @@ void
 InsertOneNull(int i)
 {
        elog(DEBUG4, "inserting column %d NULL", i);
-       Assert(i >= 0 || i < MAXATTR);
+       Assert(i >= 0 && i < MAXATTR);
        values[i] = PointerGetDatum(NULL);
        Nulls[i] = true;
 }