> When we reviewed the ecpg code,we found the array seem not have the > end > character('\0') after using the strncpy function.
True. > In the function ECPGnoticeReceiver, we use the stncpy function copy > the > sqlstate to sqlca->sqlstate. And the sqlca->sqlstate is defined as > the size > of 5, and the copy size is sizeof(sqlca->sqlstate). However, from the > previous strcmp function, the sqlstate size may be 5,such as > ECPG_SQLSTATE_INVALID_CURSOR_NAME. So there may be lack of the end > character > for sqlca->sqlstate. Why do you think there should be one? My memory might be wrong but I don't think it's supposed to be a null terminated string. Michael -- Michael Meskes Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org) Meskes at (Debian|Postgresql) dot Org Jabber: michael at xmpp dot meskes dot org VfL Borussia! Força Barça! SF 49ers! Use Debian GNU/Linux, PostgreSQL -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers