kopia lustrzana https://github.com/Hamlib/Hamlib
Remove disabled code and change signature
Makes getmyline() identical to the other simulators.pull/1831/head
rodzic
f8881f9bb9
commit
10f6504897
|
@ -50,24 +50,19 @@ static void load_dat(const char *filename, unsigned char buf[1492])
|
||||||
static unsigned char alldata[1492];
|
static unsigned char alldata[1492];
|
||||||
|
|
||||||
int
|
int
|
||||||
getmyline(int fd, char *buf)
|
getmyline(int fd, unsigned char *buf)
|
||||||
{
|
{
|
||||||
unsigned char c;
|
unsigned char c;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
int n = 0;
|
int n = 0;
|
||||||
memset(buf, 0, BUFSIZE);
|
memset(buf, 0, BUFSIZE);
|
||||||
|
|
||||||
#if 1
|
|
||||||
|
|
||||||
while (i < 5 && read(fd, &c, 1) > 0)
|
while (i < 5 && read(fd, &c, 1) > 0)
|
||||||
{
|
{
|
||||||
buf[i++] = c;
|
buf[i++] = c;
|
||||||
n++;
|
n++;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
|
||||||
n = read(fd, buf, 5);
|
|
||||||
#endif
|
|
||||||
printf("n=%d %02x %02x %02x %02x %02x\n", n, buf[0], buf[1], buf[2], buf[3],
|
printf("n=%d %02x %02x %02x %02x %02x\n", n, buf[0], buf[1], buf[2], buf[3],
|
||||||
buf[4]);
|
buf[4]);
|
||||||
return n;
|
return n;
|
||||||
|
|
Ładowanie…
Reference in New Issue