Skip to content

Commit

Permalink
Add warning log for a large value of MarkOffsetBits configuration
Browse files Browse the repository at this point in the history
* The MarkOffsetBits should be in the range of 0 to 31, the large value
  should be logged with warning message.

  Thanks to Michael Haas (mhaas) for comment.
  • Loading branch information
neutronth committed May 11, 2015
1 parent 91d6af9 commit dc8c8bc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,11 @@ config_read(const char *filename)
break;
case oMarkOffsetBits:
sscanf(p1, "%u", &config.markoffsetbits);
config.markoffsetbits = config.markoffsetbits > 31 ? 0 : config.markoffsetbits;
if (config.markoffsetbits > 31) {
config.markoffsetbits = 0;
debug(LOG_WARNING, "MarkOffsetBits is invalid. It should be in the range of 0 to 31. "
"Fallback to no offset!");
}
break;
case oBadOption:
/* FALL THROUGH */
Expand Down

0 comments on commit dc8c8bc

Please sign in to comment.