On Monday 21 Mar 2016 22:27:21 Johan Ström wrote:
> I'm quite sure the error is at ow_parseinput.c line 462:
> 
> // shorten the buffer length by the comma and discarded chars
> end -= entry_length - allowed_length - 1 ;
> 
> The purpose is to move the endpointer, but the logic is wrong, and the 
> last element length (line 441) is wrongly calculated base on 'end'.
> My currently tired brain suggests 'end -= entry_length - 1;', but I 
> might be wrong.. And I do not have any device at all which accepts an 
> aggregate ascii write.

I've been looking at this section a lot today - then going away to clear my 
head!

The first three lines display OK and the debug shows padding to these with 0x20 
bytes
<.aaa             >

The last line displays the expected string but with the last char repeated 
(ddd sent), then a series of 0x00 double-pipes before a series of 0x20
<Tdddd.....       >

It looks to my simple mind that the problem lies within the line 440

if (extension == elements - 1) {        // last element
        entry_length = end - buffer_position ;
..
}

statement. Changing this to

if (extension == elements - 1) {        // last element
        entry_length = end - buffer_position -  element - 1 ;
..
}

gets rid of the 0x00 bytes and gives good results (with limited testing so 
far) - but I still see the last char repeated and I have no idea at all where 
that is coming from

Any thoughts?

Andy

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
_______________________________________________
Owfs-developers mailing list
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers

Reply via email to