Bug 797512 Signaling: simplify set_dtls_fingerprint r=jesup
authorEthan Hugg <ethanhugg@gmail.com>
Mon, 22 Oct 2012 16:38:52 -0700
changeset 111314 f10906c2a70508ba1db3c972cabda00249a43184
parent 111313 a1925dde08ba5656733b72b5d406ab8a8b1a4479
child 111315 04a2e09f4bc1da54f8638abdb5f66a62f1eb2fd5
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
reviewersjesup
bugs797512
milestone19.0a1
Bug 797512 Signaling: simplify set_dtls_fingerprint r=jesup
media/webrtc/signaling/src/sipcc/core/gsm/gsm_sdp.c
--- a/media/webrtc/signaling/src/sipcc/core/gsm/gsm_sdp.c
+++ b/media/webrtc/signaling/src/sipcc/core/gsm/gsm_sdp.c
@@ -1582,19 +1582,18 @@ gsmsdp_set_rtcp_mux_attribute (sdp_attr_
 static void
 gsmsdp_set_dtls_fingerprint_attribute (sdp_attr_e sdp_attr, uint16_t level, void *sdp_p,
   char *hash_func,char *fingerprint)
 {
     uint16_t      a_instance = 0;
     sdp_result_e  result;
     char hash_and_fingerprint[FSMDEF_MAX_DIGEST_ALG_LEN + FSMDEF_MAX_DIGEST_LEN + 2];
 
-    sstrncpy(hash_and_fingerprint, (cc_string_t)hash_func, FSMDEF_MAX_DIGEST_ALG_LEN);
-    sstrncat(hash_and_fingerprint, (cc_string_t)" ", sizeof(hash_and_fingerprint) - strlen(hash_and_fingerprint) - 1);
-    sstrncat(hash_and_fingerprint, (cc_string_t)fingerprint, FSMDEF_MAX_DIGEST_LEN);
+    snprintf(hash_and_fingerprint, sizeof(hash_and_fingerprint),
+         "%s %s", hash_func, fingerprint);
 
     result = sdp_add_new_attr(sdp_p, level, 0, sdp_attr, &a_instance);
     if (result != SDP_SUCCESS) {
         GSM_ERR_MSG("Failed to add attribute\n");
         return;
     }
 
     result = sdp_attr_set_dtls_fingerprint_attribute(sdp_p, level, 0, sdp_attr, a_instance, hash_and_fingerprint);