From 6b368beafab7a73d30a9c5e8994b21899aa8c298 Mon Sep 17 00:00:00 2001 From: Martin Stjernholm <mast@lysator.liu.se> Date: Sun, 6 Aug 2006 00:20:41 +0200 Subject: [PATCH] Fix to cope with xalloc being a macro. Rev: src/modules/Odbc/odbc_result.c:1.50 --- src/modules/Odbc/odbc_result.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/modules/Odbc/odbc_result.c b/src/modules/Odbc/odbc_result.c index 7b0a03272f..f2309a3df7 100644 --- a/src/modules/Odbc/odbc_result.c +++ b/src/modules/Odbc/odbc_result.c @@ -2,7 +2,7 @@ || This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information. -|| $Id: odbc_result.c,v 1.49 2006/07/04 11:10:55 grubba Exp $ +|| $Id: odbc_result.c,v 1.50 2006/08/05 22:20:41 mast Exp $ */ /* @@ -577,12 +577,13 @@ static void f_fetch_row(INT32 args) #endif } else { /* Truncated, but no support for chained SQLGetData calls. */ - char *buf = xalloc((len+2) + char *buf; + SQLLEN newlen = 0; #ifdef SQL_WCHAR - * sizeof(SQLWCHAR) + buf = xalloc((len+2) * sizeof(SQLWCHAR)); +#else + buf = xalloc(len+2); #endif - ); - SQLLEN newlen = 0; code = SQLGetData(PIKE_ODBC_RES->hstmt, (SQLUSMALLINT)(i+1), PIKE_ODBC_RES->field_info[i].type, buf, (len+1) -- GitLab