B5500: Fixed Coverity bugs.

This commit is contained in:
Richard Cornwell 2017-03-14 20:50:09 -04:00
parent df1baf2528
commit 485114cae3
2 changed files with 7 additions and 3 deletions

View file

@ -3981,11 +3981,11 @@ cpu_show_hist(FILE * st, UNIT * uptr, int32 val, CONST void *desc)
int i; int i;
fprintf(st, "%o %05o%o ", h->cpu, h->c & 077777, h->l); fprintf(st, "%o %05o%o ", h->cpu, h->c & 077777, h->l);
sim_eval = (t_value)h->a_reg; sim_eval = (t_value)h->a_reg;
fprint_sym(st, 0, &sim_eval, &cpu_unit[0], SWMASK('B')); (void)fprint_sym(st, 0, &sim_eval, &cpu_unit[0], SWMASK('B'));
fputc((h->flags & F_AROF) ? '^': ' ', st); fputc((h->flags & F_AROF) ? '^': ' ', st);
fputc(' ', st); fputc(' ', st);
sim_eval = (t_value)h->b_reg; sim_eval = (t_value)h->b_reg;
fprint_sym(st, 0, &sim_eval, &cpu_unit[0], SWMASK('B')); (void)fprint_sym(st, 0, &sim_eval, &cpu_unit[0], SWMASK('B'));
fputc((h->flags & F_BROF) ? '^': ' ', st); fputc((h->flags & F_BROF) ? '^': ' ', st);
fputc(' ', st); fputc(' ', st);
fprint_val(st, (t_value)h->x_reg, 8, 39, PV_RZRO); fprint_val(st, (t_value)h->x_reg, 8, 39, PV_RZRO);

View file

@ -363,10 +363,14 @@ t_stat dtc_srv(UNIT * uptr)
switch(i) { switch(i) {
case BufNotReady: case BufNotReady:
chan_set_notrdy(chan); chan_set_notrdy(chan);
/* Fall through */
case BufInputBusy: case BufInputBusy:
/* Fall through */
case BufRead: case BufRead:
/* Fall through */
case BufReadRdy: case BufReadRdy:
chan_set_error(chan); chan_set_error(chan);
/* Fall through */
case BufOutBusy: case BufOutBusy:
chan_set_eof(chan); chan_set_eof(chan);
chan_set_end(chan); chan_set_end(chan);
@ -782,7 +786,7 @@ t_stat dtc_setnl (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
newln = (int32) get_uint (cptr, 10, DTC_MLINES, &r); newln = (int32) get_uint (cptr, 10, DTC_MLINES, &r);
if ((r != SCPE_OK) || (newln == dtc_desc.lines)) if ((r != SCPE_OK) || (newln == dtc_desc.lines))
return r; return r;
if ((newln == 0) || (newln > DTC_MLINES)) if ((newln == 0) || (newln >= DTC_MLINES))
return SCPE_ARG; return SCPE_ARG;
newln--; newln--;
if (newln < dtc_desc.lines) { if (newln < dtc_desc.lines) {