X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 6F5018BA0ED for ; Mon, 14 Feb 2005 09:57:31 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 62076-02 for ; Mon, 14 Feb 2005 09:57:27 +0000 (GMT) Received: from mail22.nhs.uk (mail22.nhs.uk [62.6.139.218]) by svr1.postgresql.org (Postfix) with ESMTP id 2C5F48BA0EC for ; Mon, 14 Feb 2005 09:57:25 +0000 (GMT) Received: from [10.191.254.3] (helo=relayint2.nhs.uk) by mail22.nhs.uk with esmtp (MTC MTA) id 1D0cyo-00059L-U2 for pgsql-odbc@postgresql.org; Mon, 14 Feb 2005 09:57:22 +0000 Received: from relay.nhs.uk (194.62.42.144) by relayint2.nhs.uk (Syntegra-I2 7.0.008) id 41C955B300DF8013 for pgsql-odbc@postgresql.org; Mon, 14 Feb 2005 09:57:22 +0000 Received: from smtp1.tayside.scot.nhs.uk (10.252.0.22) by relay.nhs.uk (Syntegra-4 7.0.008) (authenticated as smtp1_tayside_scot_nhs_uk@es2002.nhs.uk) id 420F287100034713; Mon, 14 Feb 2005 09:57:22 +0000 Received: from smtp1.tayside.scot.nhs.uk (localhost [127.0.0.1]) by localhost.tayside.scot.nhs.uk (Postfix) with ESMTP id C7E5425B7; Mon, 14 Feb 2005 09:57:20 +0000 (GMT) Received: from gonzalo.tuht.scot.nhs.uk (gonzalo.tuht.scot.nhs.uk [10.252.32.96]) by smtp1.tayside.scot.nhs.uk (Postfix) with ESMTP id AC17125B6; Mon, 14 Feb 2005 09:57:20 +0000 (GMT) Received: from [192.168.1.46] (localhost [127.0.0.1]) by gonzalo.tuht.scot.nhs.uk (iPlanet Messaging Server 5.2 HotFix 1.25 (built Mar 3 2004)) with ESMTP id <0IBW002N3BNK7Y@gonzalo.tuht.scot.nhs.uk>; Mon, 14 Feb 2005 09:57:20 +0000 (GMT) Date: Mon, 14 Feb 2005 09:57:22 +0000 From: Paul Cochrane Subject: Re: Bug in convert.c copy_and_convert_field In-reply-to: To: Dave Page , pgsql-odbc@postgresql.org Message-id: <42107602.1020700@tuht.scot.nhs.uk> Organization: TORT Centre MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7BIT X-Accept-Language: en-us, en User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) References: X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.28 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE X-Spam-Level: X-Archive-Number: 200502/67 X-Sequence-Number: 4957 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 +--------------------------------------------------------