View Single Post

   
  #1 (permalink)  
Old 04-16-2008, 03:00 AM
Ludek Finstrle
 
Posts: n/a
Default Patch for snprintf problem (bug #1000650)

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.p...125 &atid=538

The patch is created againist CVS.

Comments are welcome

Luf


---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Reply With Quote