Skip to content

Commit 9369240

Browse files
committed
Fix #8558
Issue was that with binary input the number of requested columns did not take -Cn into account.
1 parent 2015787 commit 9369240

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/gmtbinstats.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ static int parse (struct GMT_CTRL *GMT, struct GMTBINSTATS_CTRL *Ctrl, struct GM
295295
n_errors += gmt_M_check_condition (GMT, Ctrl->S.mode == -2, "Option -S: Unable to decode radius\n");
296296
n_errors += gmt_M_check_condition (GMT, Ctrl->S.mode == -3, "Option -S: Radius is negative\n");
297297
}
298-
n_errors += gmt_check_binary_io (GMT, (Ctrl->W.active) ? 4 : 3);
298+
n_errors += gmt_check_binary_io(GMT, (Ctrl->C.mode == GMTBINSTATS_COUNT) ? 2 : (Ctrl->W.active) ? 4 : 3);
299299
if (Ctrl->W.active) { /* Update the mode if median or mode */
300300
if (Ctrl->C.mode == GMTBINSTATS_MEDIAN) Ctrl->C.mode = GMTBINSTATS_MEDIANW;
301301
if (Ctrl->C.mode == GMTBINSTATS_MODE) Ctrl->C.mode = GMTBINSTATS_MODEW;

0 commit comments

Comments
 (0)