sourcestats: fix signedness in scanf format

This commit is contained in:
Miroslav Lichvar 2014-03-19 17:08:52 +01:00
parent 9479c6451e
commit 0b71504ee9

View file

@ -771,7 +771,8 @@ SST_LoadFromFile(SST_Stats inst, FILE *in)
double weight;
if (fgets(line, sizeof(line), in) &&
(sscanf(line, "%u", &inst->n_samples) == 1) && inst->n_samples <= MAX_SAMPLES) {
sscanf(line, "%d", &inst->n_samples) == 1 &&
inst->n_samples > 0 && inst->n_samples <= MAX_SAMPLES) {
line_number = 2;