diff options
author | Bruce Momjian <bruce@momjian.us> | 2002-08-28 20:46:24 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2002-08-28 20:46:24 +0000 |
commit | 81dfa2ce4328c44201a70a9dc3517bd356698069 (patch) | |
tree | ec11b0649abcb6cd2b3cb6926ff4df21ac1e570d /src/bin/psql/print.c | |
parent | f5fea0808f385677dccffa0b4dc0ffe512cb4199 (diff) | |
download | postgresql-81dfa2ce4328c44201a70a9dc3517bd356698069.tar.gz postgresql-81dfa2ce4328c44201a70a9dc3517bd356698069.zip |
backend where a statically sized buffer is written to. Most of these
should be pretty safe in practice, but it's probably better to be safe
than sorry.
I was actually looking for cases where NAMEDATALEN is assumed to be
32, but only found one. That's fixed too, as well as a few bits of
code cleanup.
Neil Conway
Diffstat (limited to 'src/bin/psql/print.c')
-rw-r--r-- | src/bin/psql/print.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/bin/psql/print.c b/src/bin/psql/print.c index f8dd092d677..bd0366528f5 100644 --- a/src/bin/psql/print.c +++ b/src/bin/psql/print.c @@ -3,7 +3,7 @@ * * Copyright 2000 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/print.c,v 1.29 2002/08/27 20:16:48 petere Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/print.c,v 1.30 2002/08/28 20:46:24 momjian Exp $ */ #include "postgres_fe.h" #include "print.h" @@ -494,9 +494,9 @@ print_aligned_vertical(const char *title, const char *const * headers, } if (opt_border == 0) - sprintf(record_str, "* Record %d", record++); + snprintf(record_str, 32, "* Record %d", record++); else - sprintf(record_str, "[ RECORD %d ]", record++); + snprintf(record_str, 32, "[ RECORD %d ]", record++); record_str_len = strlen(record_str); if (record_str_len + opt_border > strlen(divider)) |