Re: rgetmsg (esql/c) can lead one astray
Posted in 1996
: in esql/c if you call the rgetmsg function which "converts an Informix : error mesage number into the corresponding message text string" and then : send the string straight out via {f,v}printf, you will get a core dump : in certain cases as what you get back can contain format strings that : the printf routines take to indicate that you will be sending further : arguments for. example: : I got back "Error in the column name %s". sending that directly to : printf dumps core as printf is looking for something to %s print. The string value that is expected for the %s is in sqlca.sqlerrm. If, you add that to the message string you send to printf, it should work. For example: replace: printf (msgstr); with: printf (msgstr, sqlca.sqlerrm); You should get the complete message: Error in the column name fname. printf doesn't seem to care if you pass it sqlca.sqlerrm and there isn't a %s in the msgstr. June ---- June Tong Informix Software ---- ---- Senior Consultant (415) 926-6140 ---- ---- International Support junet@informix.com ---- ---- Location-du-jour: Menlo Park ---- * * Standard disclaimers apply * - Please do not send me requests/questions by mail. When I have the knowledge - and time permits, I try to answer questions on comp.databases.informix, but - travel schedule, time, and volume make responding to personal requests - difficult and often slow. Please call your local Informix Technical Support - organization for assistance with technical issues.