aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2000-04-04 03:00:16 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2000-04-04 03:00:16 +0000
commit3f94bc19d63e0410e1beed98733952357601bfe0 (patch)
tree580c0ba5bf4dbef66aa2c80a6389a692b96fd44e
parent7fbf0af22be6278c2b4e8c6c8c3e914b64cf9117 (diff)
downloadpostgresql-3f94bc19d63e0410e1beed98733952357601bfe0.tar.gz
postgresql-3f94bc19d63e0410e1beed98733952357601bfe0.zip
Correct off-by-one error in strncat() usage.
-rw-r--r--src/interfaces/odbc/convert.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/interfaces/odbc/convert.c b/src/interfaces/odbc/convert.c
index f87b9157799..3d282002931 100644
--- a/src/interfaces/odbc/convert.c
+++ b/src/interfaces/odbc/convert.c
@@ -688,9 +688,9 @@ int lobj_fd, retval;
oldstmtlen = strlen(old_statement);
- for (opos = 0; opos < oldstmtlen; opos++) {
+ for (opos = 0; opos < oldstmtlen; opos++) {
- // Squeeze carriage-returns/linfeed pairs to linefeed only
+ // Squeeze carriage-return/linefeed pairs to linefeed only
if (old_statement[opos] == '\r' && opos+1 < oldstmtlen &&
old_statement[opos+1] == '\n') {
continue;
@@ -1156,7 +1156,7 @@ char key[33];
*funcEnd = svchar;
while ((*funcEnd != '\0') && isspace(*funcEnd)) funcEnd++;
- /* We expect left parenthensis here,
+ /* We expect left parenthesis here,
* else return fn body as-is since it is
* one of those "function constants".
*/
@@ -1175,7 +1175,7 @@ char key[33];
}
/* copy mapped name and remaining input string */
strcpy(escape, mapFunc);
- strncat(escape, funcEnd, sizeof(escape)-strlen(mapFunc));
+ strncat(escape, funcEnd, sizeof(escape)-1-strlen(mapFunc));
}
else {
/* Bogus key, leave untranslated */