freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
- From: "Winkless, Geoff" <geoff.winkless AT pera.com>
- To: 'TDS Development Group' <freetds AT franklin.metalab.unc.edu>
- Subject: Re: Escape string function
- Date: Thu, 11 Jul 2002 16:41:23 +0100
Brian wrote:
> Not to mention lack of comments. ;-) I could have incremented
> the pointers
> directly to save a bit, but figured I'd go with the understandable
> version.
> There should be a terminator added before returning too, oops!
> > > outstr = malloc(strlen(outstr) + need + 1);
> > > > > for (i=0;i<strlen(instr);i++) {
Yeuck. Really you should do
for (i=0; instr[i]!=0; i++) {
....
in both loops, and
outstr = malloc(i + need);
instead of using strlen()
Geoff
-
Escape string function,
Phil Taylor, 07/11/2002
- <Possible follow-up(s)>
- Re: Escape string function, Brian Bruns, 07/11/2002
- Re: Escape string function, Thompson, Bill D (London), 07/11/2002
- Re: Escape string function, Brian Bruns, 07/11/2002
- Re: Escape string function, Winkless, Geoff, 07/11/2002
- Re: Escape string function, ZIGLIO Frediano, 07/11/2002
- Re: Escape string function, Michael Peppler, 07/11/2002
- Re: Escape string function, Brian Bruns, 07/11/2002
- Re: Escape string function, Brian Bruns, 07/11/2002
Archive powered by MHonArc 2.6.24.