/*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2012-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
if ((options_ & COLOR) == 0 && ((options_ & COLOR_IF_TTY) == 0 || !isTty_)) {
return;
}
- if (color < 0 || color >= kColorMap.size()) {
+ if (static_cast<size_t>(color) >= kColorMap.size()) { // catches underflow too
return;
}
doPrint(kColorMap[color]);