Avoid some potential divide by zero errors that Clang reports.

svn path=/trunk/; revision=41923
This commit is contained in:
Chris Maynard 2012-04-04 12:47:08 +00:00
parent a42cb82d65
commit 523cbecd1a
2 changed files with 2 additions and 2 deletions

View File

@ -804,7 +804,7 @@ dissect_artnet_output(tvbuff_t *tvb, guint offset, proto_tree *tree)
/* ToDo: consider recoding slightly ... */
for (r=0; r < row_count;r++) {
for (c=0;(c < global_disp_col_count) && (((r*global_disp_col_count)+c) < length);c++) {
if ((c % (global_disp_col_count/2)) == 0) {
if ((global_disp_col_count > 1) && (c % (global_disp_col_count/2)) == 0) {
ptr += g_snprintf(ptr, (gulong)(sizeof string - strlen(string)), " ");
}

View File

@ -282,7 +282,7 @@ dissect_enttec_dmx_data(tvbuff_t *tvb, guint offset, proto_tree *tree)
dmx_epstr = ep_strbuf_new_label(NULL);
for (r=0; r < row_count;r++) {
for (c=0;(c < global_disp_col_count) && (((r*global_disp_col_count)+c) < ui);c++) {
if ((c % (global_disp_col_count/2)) == 0) {
if ((global_disp_col_count > 1) && (c % (global_disp_col_count/2)) == 0) {
ep_strbuf_append_c(dmx_epstr, ' ');
}
v = dmx_data[(r*global_disp_col_count)+c];