From bb7bea87094f5796408f41391cd5039f99faa053 Mon Sep 17 00:00:00 2001 From: Fabrice Bellet Date: Tue, 9 Jul 2019 15:17:12 +0200 Subject: examples: fix compiler extra warnings --- examples/simple-example.c | 2 +- examples/threaded-example.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/simple-example.c b/examples/simple-example.c index a26c422..b4da1e2 100644 --- a/examples/simple-example.c +++ b/examples/simple-example.c @@ -311,7 +311,7 @@ parse_candidate(char *scand, guint _stream_id) cand->component_id = 1; cand->stream_id = _stream_id; cand->transport = NICE_CANDIDATE_TRANSPORT_UDP; - strncpy(cand->foundation, tokens[0], NICE_CANDIDATE_MAX_FOUNDATION); + strncpy(cand->foundation, tokens[0], NICE_CANDIDATE_MAX_FOUNDATION - 1); cand->foundation[NICE_CANDIDATE_MAX_FOUNDATION - 1] = 0; cand->priority = atoi (tokens[1]); diff --git a/examples/threaded-example.c b/examples/threaded-example.c index a1eafae..6df6ac2 100644 --- a/examples/threaded-example.c +++ b/examples/threaded-example.c @@ -333,7 +333,7 @@ parse_candidate(char *scand, guint stream_id) cand->component_id = 1; cand->stream_id = stream_id; cand->transport = NICE_CANDIDATE_TRANSPORT_UDP; - strncpy(cand->foundation, tokens[0], NICE_CANDIDATE_MAX_FOUNDATION); + strncpy(cand->foundation, tokens[0], NICE_CANDIDATE_MAX_FOUNDATION - 1); cand->foundation[NICE_CANDIDATE_MAX_FOUNDATION - 1] = 0; cand->priority = atoi (tokens[1]); -- cgit v1.2.1