[Hamlib-developer] RE: [Hamlib-cvs-digest] CVS: hamlib/src iofunc.c,1.1,1.2 iofunc.
Library to control radio transceivers and receivers
Brought to you by:
n0nb
|
From: Chuck H. <n2...@am...> - 2002-03-12 09:31:56
|
You might want to undo this particular part of the patch. Assuming that rxmax
is the max size of the buffer, since your adding the '\000' character to the end
of the returned string, you only want to read up to rxmax-1 characters.
I had changed that in my routine because:
1. I dropped the trailing '\000'
2. read_icom_block was calling my routine with the expected frame length
rather then the buffer size. Otherwise I'd miss the last character.
Since you didn't do 1 and killed the need for 2, it probably should be rxmax-1.
On 10-Mar-02 Stephane Fillod wrote:
> *** iofunc.c 16 Jan 2002 22:56:34 -0000 1.1
> --- iofunc.c 10 Mar 2002 23:41:39 -0000 1.2
> ***************
> *** 292,296 ****
> tv_timeout.tv_usec = (p->timeout%1000)*1000;
>
> ! while (total_count < (rxmax-1)) {
> tv = tv_timeout; /* select may have updated it */
>
> --- 291,295 ----
> tv_timeout.tv_usec = (p->timeout%1000)*1000;
>
> ! while (total_count < rxmax) {
> tv = tv_timeout; /* select may have updated it */
>
|