Letting strncpy do its job. Landing and extending http://webrtc-codereview.appspot.com/329010/ on behalf of tbreisacher.

Review URL: http://webrtc-codereview.appspot.com/335009

git-svn-id: http://webrtc.googlecode.com/svn/trunk@1260 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
niklas.enbom@webrtc.org 2011-12-21 08:59:31 +00:00
parent 8c5d24266e
commit 6c9be123ef

View File

@ -457,16 +457,13 @@ void RemoteRateControl::StateStr(RateControlState state, char* str)
switch (state)
{
case kRcDecrease:
strncpy(str, "DECREASE", 8);
str[8] = 0;
strncpy(str, "DECREASE", 9);
break;
case kRcHold:
strncpy(str, "HOLD", 4);
str[4] = 0;
strncpy(str, "HOLD", 5);
break;
case kRcIncrease:
strncpy(str, "INCREASE", 8);
str[8] = 0;
strncpy(str, "INCREASE", 9);
break;
}
}
@ -476,16 +473,13 @@ void RemoteRateControl::StateStr(BandwidthUsage state, char* str)
switch (state)
{
case kBwNormal:
strncpy(str, "NORMAL", 6);
str[6] = 0;
strncpy(str, "NORMAL", 7);
break;
case kBwOverusing:
strncpy(str, "OVER USING", 10);
str[10] = 0;
strncpy(str, "OVER USING", 11);
break;
case kBwUnderUsing:
strncpy(str, "UNDER USING", 11);
str[11] = 0;
strncpy(str, "UNDER USING", 12);
break;
}
}