[PATCH] useless CHECK_NULP in dblib.c:tdsdbopen()
"Craig A. Berry" <[email protected]>
| Newsgroups | gmane.comp.db.tds.freetds |
|---|---|
| Message-ID | <[email protected]> |
The CHECK_NULP statement removed by the attached patch is not actually checking anything except whether random data from the stack is non- zero. Usually it will be, but why depend on it and what good would it do to know that? My compiler said something about "dbproc fetched but not initialized" and I'm sure gcc and other compilers have ways to generate similar warnings. ________________________________________ Craig A. Berry mailto:[email protected] "... getting out of a sonnet is much more difficult than getting in." Brad Leithauser _______________________________________________ FreeTDS mailing list [email protected] http://lists.ibiblio.org/mailman/listinfo/freetds
nulp.patch
(application/octet-stream, 421 B)
--- src/dblib/dblib.c;-1 2009-03-19 18:53:59 -0500
+++ src/dblib/dblib.c 2009-03-19 18:58:24 -0500
@@ -1097,8 +1097,6 @@ tdsdbopen(LOGINREC * login, const char *
tdsdump_log(TDS_DBG_FUNC, "dbopen(%p, %s, [%s])\n", login, server, msdblib? "microsoft" : "sybase");
- CHECK_NULP(server, "dbopen", 2, NULL);
-
if ((dbproc = calloc(1, sizeof(DBPROCESS))) == NULL) {
dbperror(NULL, SYBEMEM, errno);
return NULL;