Skip to Content.
Sympa Menu

freetds - Re: looking for dbfcmd

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Brian Bruns" <camber AT ais.org>
  • To: freetds AT franklin.oit.unc.edu
  • Subject: Re: looking for dbfcmd
  • Date: Thu, 15 Mar 2001 16:32:35 -0500


> I'm checking out freetds for the first time. I've noticed in
> the unit test modules for libdb a sprintf was used to accomplish
> the same thing. I have a lot of code which would require changes.
> Any one know of a fix?
>
> Thanks,
> Steve

This code snipet should work...just add it to src/dblib/dblib.c and
recompile.
The only major thing wrong with it is that the 'tmpstr' is statically
sized at 4096 bytes...we need a way to determine the size of the resulting
string.

Brian

RETCODE dbfcmd(DBPROCESS *dbproc, char *fmt, ...)
{
va_list ap;
char tmpstr[4096];

va_start(ap, fmt);
vsprintf(tmpstr, fmt, ap);
va_end(ap);
dbcmd(dbproc, tmpstr);
}





Archive powered by MHonArc 2.6.24.

Top of Page