examples: fix compiler extra warnings
authorFabrice Bellet <fabrice@bellet.info>
Tue, 9 Jul 2019 13:17:12 +0000 (15:17 +0200)
committerOlivier CrĂȘte <olivier.crete@ocrete.ca>
Thu, 11 Jul 2019 19:03:03 +0000 (19:03 +0000)
examples/simple-example.c
examples/threaded-example.c

index a26c422..b4da1e2 100644 (file)
@@ -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]);
 
index a1eafae..6df6ac2 100644 (file)
@@ -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]);