[freetds] some small patches...

Thompson, Bill D (London) ThompBil at exchange.uk.ml.com
Tue Apr 15 11:47:09 EDT 2003


> Seems to me that _set_null_value should use sizeof().  

> _set_null_value(DBPROCESS * dbproc, BYTE * varaddr, int datatype, int
> maxlen)
> {
>     switch (datatype) {
>     case SYBINT8:
-         memset(varaddr, '\0', 8);
+         memset(varaddr, '\0', sizeof(TDS_INT8));
>         break;
...
> +    case SYBDATETIME:
> -        memset(varaddr, '\0', 8);
> +        memset(varaddr, '\0', sizeof(TDS_DATETIME));
> +        break;

> would be more expressive


agreed.

> -----Original Message-----
> From:	Lowden, James K [SMTP:LowdenJK at bernstein.com]
> Sent:	15 April 2003 16:37
> To:	'FreeTDS Development Group'
> Subject:	RE: [freetds] some small patches...
> 
> > From: Thompson, Bill D (London) [mailto:ThompBil at exchange.uk.ml.com]
> > Sent: April 15, 2003 8:38 AM
> >
> Seems to me that _set_null_value should use sizeof().  
> 
> > _set_null_value(DBPROCESS * dbproc, BYTE * varaddr, int datatype, int
> > maxlen)
> > {
> >     switch (datatype) {
> >     case SYBINT8:
> -         memset(varaddr, '\0', 8);
> +         memset(varaddr, '\0', sizeof(TDS_INT8));
> >         break;
> ...
> > +    case SYBDATETIME:
> > -        memset(varaddr, '\0', 8);
> > +        memset(varaddr, '\0', sizeof(TDS_DATETIME));
> > +        break;
> 
> would be more expressive.  
> 
> --jkl
> 
> 
> The information contained in this transmission may contain privileged and
> confidential information and is intended only for the use of the person(s)
> named above.  If you are not the intended recipient, or an employee or
> agent
> responsible for delivering this message to the intended recipient, any
> review, dissemination, distribution or duplication of this communication
> is
> strictly prohibited. If you are not the intended recipient, please contact
> the sender immediately by reply e-mail and destroy all copies of the
> original message. Please note that we do not accept account orders and/or
> instructions by e-mail, and therefore will not be responsible for carrying
> out such orders and/or instructions.
> 
> 
> _______________________________________________
> FreeTDS mailing list
> FreeTDS at lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds



More information about the FreeTDS mailing list