diff options
author | Marc G. Fournier <scrappy@hub.org> | 1998-12-14 05:19:16 +0000 |
---|---|---|
committer | Marc G. Fournier <scrappy@hub.org> | 1998-12-14 05:19:16 +0000 |
commit | 7c3b7d27446cbe7e4d1ccf6f51caf2d38f55916c (patch) | |
tree | 77cf346913929743b747b012d14780fb369d7041 /src/backend/access/gist/gist.c | |
parent | f722af618a5d6cedb0e083397f6efcec2e07b0c8 (diff) | |
download | postgresql-7c3b7d27446cbe7e4d1ccf6f51caf2d38f55916c.tar.gz postgresql-7c3b7d27446cbe7e4d1ccf6f51caf2d38f55916c.zip |
Initial attempt to clean up the code...
Switch sprintf() to snprintf()
Remove any/all #if 0 -or- #ifdef NOT_USED -or- #ifdef FALSE sections of
code
Diffstat (limited to 'src/backend/access/gist/gist.c')
-rw-r--r-- | src/backend/access/gist/gist.c | 30 |
1 files changed, 1 insertions, 29 deletions
diff --git a/src/backend/access/gist/gist.c b/src/backend/access/gist/gist.c index f57c0432b5e..a7617842042 100644 --- a/src/backend/access/gist/gist.c +++ b/src/backend/access/gist/gist.c @@ -1326,34 +1326,6 @@ _gistdump(Relation r) } } -#ifdef NOT_USED -static char * -text_range_out(TXTRANGE *r) -{ - char *result; - char *lower, - *upper; - - if (r == NULL) - return NULL; - result = (char *) palloc(NAMEDATALEN + VARSIZE(TRLOWER(r)) + VARSIZE(TRUPPER(r)) - - 2 * VARHDRSZ); - - lower = (char *) palloc(VARSIZE(TRLOWER(r)) + 1 - VARHDRSZ); - memcpy(lower, VARDATA(TRLOWER(r)), VARSIZE(TRLOWER(r)) - VARHDRSZ); - lower[VARSIZE(TRLOWER(r)) - VARHDRSZ] = '\0'; - upper = (char *) palloc(VARSIZE(TRUPPER(r)) + 1 - VARHDRSZ); - memcpy(upper, VARDATA(TRUPPER(r)), VARSIZE(TRUPPER(r)) - VARHDRSZ); - upper[VARSIZE(TRUPPER(r)) - VARHDRSZ] = '\0'; - - sprintf(result, "[%s,%s): %d", lower, upper, r->flag); - pfree(lower); - pfree(upper); - return result; -} - -#endif - static char * int_range_out(INTRANGE *r) { @@ -1362,7 +1334,7 @@ int_range_out(INTRANGE *r) if (r == NULL) return NULL; result = (char *) palloc(80); - sprintf(result, "[%d,%d): %d", r->lower, r->upper, r->flag); + snprintf(result, 80, "[%d,%d): %d", r->lower, r->upper, r->flag); return result; } |