Commit ecdf95f6 authored by Bruce Momjian's avatar Bruce Momjian

This patch fixes the undefined (according to C) and erroneous (under

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
parent 5c431eb1
/*------------------------------------------------------- /*-------------------------------------------------------
* *
* $Id: Pg.xs,v 1.9 1998/09/27 19:12:23 mergl Exp $ * $Id: Pg.xs,v 1.10 1998/12/13 02:50:20 momjian Exp $
* *
* Copyright (c) 1997, 1998 Edmund Mergl * Copyright (c) 1997, 1998 Edmund Mergl
* *
...@@ -215,7 +215,8 @@ PQconnectdb(conninfo) ...@@ -215,7 +215,8 @@ PQconnectdb(conninfo)
} }
} else { } else {
while (*ptr && *ptr != ' ' && *ptr != '\t') { while (*ptr && *ptr != ' ' && *ptr != '\t') {
*ptr++ = tolower(*ptr); *ptr = tolower(*ptr);
ptr++;
} }
} }
} }
...@@ -732,7 +733,8 @@ connectdb(conninfo) ...@@ -732,7 +733,8 @@ connectdb(conninfo)
} }
} else { } else {
while (*ptr && *ptr != ' ' && *ptr != '\t') { while (*ptr && *ptr != ' ' && *ptr != '\t') {
*ptr++ = tolower(*ptr); *ptr = tolower(*ptr);
ptr++;
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment