FreeTDM: Add gcc printf()-style format string checks to ftdm_log(), also add FTDM_(U)INT64_FMT and FTDM_TIME_FMT constants.

The format string checks already caught a couple crash-worthy bugs and this
commit fixes a couple more.

Also includes __ftdm_check_scanf(), for completeness (currently unused).

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
This commit is contained in:
Stefan Knoblich
2012-07-11 22:38:25 +02:00
parent 1e7d214ae6
commit f384e247fc
7 changed files with 48 additions and 7 deletions

View File

@@ -144,7 +144,7 @@ int main(int argc, char *argv[])
ftdm_channel_call_indicate(lchan, ind);
stop = ftdm_current_time_in_ms();
diff = stop - start;
ftdm_log(FTDM_LOG_DEBUG, "Setting indication %s took %llums\n",
ftdm_log(FTDM_LOG_DEBUG, "Setting indication %s took %"FTDM_TIME_FMT" ms\n",
ftdm_channel_indication2str(ind), diff);
}
}