Imported Upstream version 0.1.17
[platform/upstream/libnice.git] / examples / threaded-example.c
index 575b4dc..6df6ac2 100644 (file)
@@ -311,7 +311,7 @@ static NiceCandidate *
 parse_candidate(char *scand, guint stream_id)
 {
   NiceCandidate *cand = NULL;
-  NiceCandidateType ntype;
+  NiceCandidateType ntype = NICE_CANDIDATE_TYPE_HOST;
   gchar **tokens = NULL;
   guint i;
 
@@ -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]);