From: Alexandre Montplaisir Date: Wed, 7 Dec 2011 15:36:10 +0000 (-0500) Subject: Fix format string warnings X-Git-Tag: v1.5-beta1~101 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=33ee50ddbdfb14ceab14d92bdeb9bb10ef522e0b;p=lttv.git Fix format string warnings Or `make check' fails when building with -Werror=format-security (which is what Launchpad uses). Signed-off-by: Alexandre Montplaisir Signed-off-by: Mathieu Desnoyers --- diff --git a/lttv/lttv/sync/event_processing_text.c b/lttv/lttv/sync/event_processing_text.c index bcbea9b2..a99d0e39 100644 --- a/lttv/lttv/sync/event_processing_text.c +++ b/lttv/lttv/sync/event_processing_text.c @@ -95,7 +95,7 @@ static void initProcessingText(SyncState* const syncState, ...) processingData->testCase= fopen(testCaseName, "r"); if (processingData->testCase == NULL) { - g_error(strerror(errno)); + g_error("%s", strerror(errno)); } syncState->traceNb= readTraceNb(processingData->testCase); @@ -162,7 +162,7 @@ static AllFactors* finalizeProcessingText(SyncState* const syncState) if (retval == -1 && !feof(testCase)) { - g_error(strerror(errno)); + g_error("%s", strerror(errno)); } if (line[retval - 1] == '\n') @@ -174,7 +174,7 @@ static AllFactors* finalizeProcessingText(SyncState* const syncState) &sendTime, &recvTime, &tmp); if (retval == EOF) { - g_error(strerror(errno)); + g_error("%s", strerror(errno)); } else if (retval != 4) { @@ -311,7 +311,7 @@ static unsigned int readTraceNb(FILE* testCase) } else { - g_error(strerror(errno)); + g_error("%s", strerror(errno)); } } if (line[retval - 1] == '\n') @@ -365,7 +365,7 @@ static void skipCommentLines(FILE* testCase) } else { - g_error(strerror(errno)); + g_error("%s", strerror(errno)); } } } diff --git a/lttv/lttv/sync/sync_chain_unittest.c b/lttv/lttv/sync/sync_chain_unittest.c index 40302a0e..276c71ce 100644 --- a/lttv/lttv/sync/sync_chain_unittest.c +++ b/lttv/lttv/sync/sync_chain_unittest.c @@ -256,7 +256,7 @@ int main(const int argc, char* const argv[]) if (fclose(syncState->graphsStream) != 0) { - g_error(strerror(errno)); + g_error("%s", strerror(errno)); } }