From: Paul Cochrane <paul.m.cochrane@tuht.scot.nhs.uk>
To: Dave Page <dpage@vale-housing.co.uk>
To: pgsql-odbc@postgresql.org
Subject: Re: Bug in convert.c copy_and_convert_field
Date: Mon, 14 Feb 2005 09:57:22 +0000
Message-ID: <42107602.1020700@tuht.scot.nhs.uk> (raw)
In-Reply-To: <E7F85A1B5FF8D44C8A1AF6885BC9A0E4528AD4@ratbert.vale-housing.co.uk>
References: <E7F85A1B5FF8D44C8A1AF6885BC9A0E4528AD4@ratbert.vale-housing.co.uk>
Dave Page wrote:
>
>
>>Subject: Re: [ODBC] Bug in convert.c copy_and_convert_field
>>
>>I've found a quick fix to this problem. I've simply added a line:
>>
>> strncpy(ptr+len, "\0", 1);
>>
>>just before the mylog line on line 850 of convert.c. I believe this
>>simply ensures that there is a NULL at the end of the string
>>stored in
>>ptr. There may be a more elegant way to do this but it seems to work.
>>
>>
>
>I don't know if this fix is correct or not, but are you sure that ptr is
>big enough to do this without clobbering something else?
>
>Regards, Dave.
>
>
To be honest, I'm not entirely sure. I'm guessing that it's OK since the
returned LEN vaule seems to be set correctly. The mylog just returns
rubbish as the string value which I took to be related to not having a
NULL at the end of the string.
Paul
--
Paul Cochrane (paul.m.cochrane@tuht.scot.nhs.uk)
+--------------------------------------------------------
| Tayside Orthopaedic & Rehabilitation Technology Centre
| Ninewells Hospital & Medical School
| Dundee, Scotland, UK.
| DD1 9SY
| Phone: Internal: 36284
| External: +44 (1382) 496284
| Fax: +44 (1382) 496322
+--------------------------------------------------------
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-odbc@postgresql.org
Cc: paul.m.cochrane@tuht.scot.nhs.uk, dpage@vale-housing.co.uk
Subject: Re: Bug in convert.c copy_and_convert_field
In-Reply-To: <42107602.1020700@tuht.scot.nhs.uk>
References: <E7F85A1B5FF8D44C8A1AF6885BC9A0E4528AD4@ratbert.vale-housing.co.uk> <42107602.1020700@tuht.scot.nhs.uk>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox