Skip to content

Commit 1b3efa8

Browse files
Merge branch 'demo5' of https://github.com/rtklibexplorer/RTKLIB into demo5
2 parents c4e5df8 + 13178b0 commit 1b3efa8

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

app/qtapp/strsvr_qt/mondlg.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ StrMonDialog::StrMonDialog(QWidget *parent)
3030
for (int i = 0; i <= MAXRCVFMT; i++) {
3131
ui->cBSelectFormat->addItem(formatstrs[i]);
3232
}
33+
memset(&rtcm, 0, sizeof(rtcm));
34+
memset(&raw, 0, sizeof(raw));
3335
rtcm.outtype = raw.outtype = 1;
3436
}
3537
//---------------------------------------------------------------------------

app/winapp/strsvr/mondlg.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ __fastcall TStrMonDialog::TStrMonDialog(TComponent* Owner)
2929
for (int i=0;i<=MAXRCVFMT;i++) {
3030
SelFmt->Items->Add(formatstrs[i]);
3131
}
32+
memset(&rtcm,0,sizeof(rtcm));
33+
memset(&raw,0,sizeof(raw));
3234
rtcm.outtype=raw.outtype=1;
3335
}
3436
//---------------------------------------------------------------------------

src/streamsvr.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,8 +464,13 @@ static void periodic_cmd(int cycle, const char *cmd, stream_t *stream)
464464
period=0;
465465
if ((r=strrchr(msg,'#'))) {
466466
sscanf(r,"# %d",&period);
467-
*r='\0';
468-
while (*--r==' ') *r='\0'; /* delete tail spaces */
467+
size_t end=r-msg;
468+
msg[end]='\0';
469+
/* Delete tailing spaces */
470+
while (end>0) {
471+
if (msg[end-1]!=' ') break;
472+
msg[--end]='\0';
473+
}
469474
}
470475
if (period<=0) period=1000;
471476
if (*msg&&cycle%period==0) {

0 commit comments

Comments
 (0)