This patch fixes the undefined (according to C) and erroneous (under
authorBruce Momjian <bruce@momjian.us>
Sun, 13 Dec 1998 02:50:39 +0000 (02:50 +0000)
committerBruce Momjian <bruce@momjian.us>
Sun, 13 Dec 1998 02:50:39 +0000 (02:50 +0000)
Digital Uni x with both DEC cc and gcc) behaviour of modifying an
lvalue on the left side an d then using it on the right side of an
assignment. Since this code modifies the
 dbname parameter, it was changing, for example, "dbname=template1"
 into "dbname =emplate1".

David Smith Programmer P

src/interfaces/perl5/Pg.xs

index d4697a9a32812c71e2b1ad09c1d86d68dfdc165e..66c322d843ebbadbb9abeff65366f0355912562f 100644 (file)
@@ -215,7 +215,8 @@ PQconnectdb(conninfo)
                                }
                        } else {
                                while (*ptr && *ptr != ' ' && *ptr != '\t') {
-                                       *ptr++ = tolower(*ptr);
+                                     *ptr = tolower(*ptr);
+                                     ptr++;
                                }
                        }
                }
@@ -732,7 +733,8 @@ connectdb(conninfo)
                                }
                        } else {
                                while (*ptr && *ptr != ' ' && *ptr != '\t') {
-                                       *ptr++ = tolower(*ptr);
+                                       *ptr = tolower(*ptr);
+                                       ptr++;
                                }
                        }
                }