Skip site navigation (1) Skip section navigation (2)

Patch for snprintf problem (bug #1000650)

From: Ludek Finstrle <luf(at)pzkagis(dot)cz>
To: pgsql-odbc(at)postgresql(dot)org
Subject: Patch for snprintf problem (bug #1000650)
Date: 2006-06-07 17:39:10
Message-ID: 20060607173910.GA28221@soptik.pzkagis.cz (view raw or flat)
Thread:
Lists: 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

Responses

pgsql-odbc by date

Next:From: Glenn B. LawlerDate: 2006-06-07 19:03:56
Subject: DescribParam
Previous:From: noreplyDate: 2006-06-07 11:41:21
Subject: [ psqlodbc-Bugs-1000467 ] Can't use (b)lobs with Omnis Studio v4

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group