snprintf() instead of sprintf() ?

From: "Hiroshi Inoue" <Inoue(at)tpf(dot)co(dot)jp>
To: "pgsql-hackers" <pgsql-hackers(at)postgreSQL(dot)org>
Subject: snprintf() instead of sprintf() ?
Date: 1999-03-16 02:44:05
Message-ID: 000101be6f56$dbbfc000$2801007e@cadzone.tpf.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello all,

CREATE USER/ALTER USER doesn't work well for
99/02/23 snapshot;

=> create user user1;
ERROR: Bad abstime external representation ''

I didn't understand the reason.

=> alter user fred createuser;
ERROR: parser: parse error at or near "where"

I found it's because of the use snprintf() instead
of sprintf(). Different from sprintf(),snprintf()
clears its target first.
AlterUser() function uses the statement such as

snprintf(sql, "....", sql, ...)

In this case,the content of sql which is also a
source of snprintf is cleared before execution.

Thanks.

Hiroshi Inoue
Inoue(at)tpf(dot)co(dot)jp

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 1999-03-16 02:45:36 [CURRENT] contrib/array_iterator patch
Previous Message Tatsuo Ishii 1999-03-16 02:16:28 Re: [HACKERS] Re: your mail