Patch for snprintf problem (bug #1000650) - Mailing list pgsql-odbc

From Ludek Finstrle
Subject Patch for snprintf problem (bug #1000650)
Date
Msg-id 20060607173910.GA28221@soptik.pzkagis.cz
Whole thread Raw
Responses Re: Patch for snprintf problem (bug #1000650)  (Ludek Finstrle <luf@pzkagis.cz>)
Re: Patch for snprintf problem (bug #1000650)  (Hiroshi Inoue <inoue@tpf.co.jp>)
List pgsql-odbc
Hello,

  I found the problem in snprintf on linux (maybe another unix) boxes
in info.c (CVS HEAD). The problematic part is something like:

buf = "text";
snprintf(buf,size,"%s append",buf);

buf = "text append" on Windows (MS VC compiler)
buf = " append" on linux (gcc compiler)

I solve it this way (main idea):
snprintf(buf + strlen(buf), " append");

There are more parameters (char *, int, ...) in real usage.
More details is here:
http://pgfoundry.org/tracker/index.php?func=detail&aid=1000650&group_id=1000125&atid=538

The patch is created againist CVS.

Comments are welcome

Luf

Attachment

pgsql-odbc by date:

Previous
From:
Date:
Subject: [ psqlodbc-Bugs-1000467 ] Can't use (b)lobs with Omnis Studio v4
Next
From: "Glenn B. Lawler"
Date:
Subject: DescribParam