From: | Paul Cochrane <paul(dot)m(dot)cochrane(at)tuht(dot)scot(dot)nhs(dot)uk> |
---|---|
To: | Dave Page <dpage(at)vale-housing(dot)co(dot)uk>, pgsql-odbc(at)postgresql(dot)org |
Subject: | Re: Bug in convert.c copy_and_convert_field |
Date: | 2005-02-14 09:57:22 |
Message-ID: | 42107602.1020700@tuht.scot.nhs.uk |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-odbc |
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(dot)m(dot)cochrane(at)tuht(dot)scot(dot)nhs(dot)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
+--------------------------------------------------------
From | Date | Subject | |
---|---|---|---|
Next Message | Bruno R. Almeida | 2005-02-14 10:49:32 | ODBC PostgreSQL 8.0 |
Previous Message | Joost Kraaijeveld | 2005-02-13 20:22:03 | Bug in ODBC driver 08.00.0004 and stored procedure |