Jeff King <peff@xxxxxxxx> writes: > So given the fact that these are insane cases which we have no need to > support, the weird behavior from feeding the results to printf even if > the code is careful, and the possibility of uncareful code introducing > its own integer truncation issues, let's just declare INT_MAX as a limit > for parsing config files. Makes sense. > + if (c != EOF && ++cf->total_len > INT_MAX) { Would this work correctly if size_t is uint? Sure, as int-max would fit within it. And of course if size_t is wider than uint, there is no problem in this comparison. Thanks.