Skip to Content.
Sympa Menu

freetds - Clean up gcc'ism

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Castellano, Nicholas" <Nicholas_Castellano AT acml.com>
  • To: "'freetds AT franklin.oit.unc.edu'" <freetds AT franklin.metalab.unc.edu>
  • Subject: Clean up gcc'ism
  • Date: Thu, 22 Aug 2002 15:36:51 -0400


This patch removes an ugly gcc'ism in config.c. This allows the code to
compile with DEC's native cc.

Index: src/tds/config.c
===================================================================
RCS file: /cvsroot/freetds/freetds/src/tds/config.c,v
retrieving revision 1.21
diff -u -r1.21 config.c
--- src/tds/config.c 22 Aug 2002 05:24:20 -0000 1.21
+++ src/tds/config.c 22 Aug 2002 19:30:51 -0000
@@ -571,8 +571,7 @@

/* Storage for reentrant getaddrby* calls */
struct hostent result;
- int buflen = 4096;
- char buffer[buflen];
+ char buffer[4096];
int h_errnop;

/* Storage for reentrant getservbyname */
@@ -583,7 +582,7 @@
mlilback 3/2/02 */
ip_addr = inet_addr(servername);
if (ip_addr == INADDR_NONE)
- host = tds_gethostbyname_r(servername, &result, buffer, buflen,
&h_errnop);
+ host = tds_gethostbyname_r(servername, &result, buffer,
sizeof(buffer), &h_errnop);

#ifndef NOREVERSELOOKUPS
/* froy AT singleentry.com 12/21/2000 */
@@ -595,7 +594,7 @@
addr [1] = a1;
addr [2] = a2;
addr [3] = a3;
- host = tds_gethostbyaddr_r (addr, 4, AF_INET, &result,
buffer, buflen, &h_errnop);
+ host = tds_gethostbyaddr_r (addr, 4, AF_INET, &result,
buffer, sizeof(buffer), &h_errnop);
}
/* end froy */
#endif
@@ -610,7 +609,7 @@
strncpy(ip, inet_ntoa(*ptr), 17);
}
if (portname) {
- service = tds_getservbyname_r(portname, "tcp", &serv_result,
buffer, buflen);
+ service = tds_getservbyname_r(portname, "tcp", &serv_result,
buffer, sizeof(buffer));
if (service==NULL) {
num = atoi(portname);
} else {


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 for certain accounts we do not accept
orders and/or instructions by e-mail, and for those accounts we will not be
responsible for carrying out such orders and/or instructions. Kindly refrain
from sending orders or instructions by e-mail unless you have confirmed that
we accept such communications for your account. Please also note that to
satisfy regulatory requirements we review the outgoing and incoming e-mail
correspondence of staff members serving certain functions.





  • Clean up gcc'ism, Castellano, Nicholas, 08/22/2002

Archive powered by MHonArc 2.6.24.

Top of Page