Bug 1308100 - Replace PL_strlen/PL_strnlen with strlen/strnlen;r=erahm

MozReview-Commit-ID: CGnzomkIsi5
***
Bug 1308100 - Replace PL_strlen/PL_strnlen with strlen/strnlen;r?erahm

--HG--
extra : rebase_source : a14b1538ed91848ecd02fb4607bce4cb9b2ab7c4
This commit is contained in:
Adam Velebil 2017-04-13 20:47:00 +02:00
Родитель a80ecbe06a
Коммит 69da80395b
4 изменённых файлов: 5 добавлений и 6 удалений

Просмотреть файл

@ -458,7 +458,7 @@ static void sdp_attr_fmtp_invalid_value(sdp_t *sdp, const char *param_name,
*/
static sdp_result_e sdp_verify_attr_fmtp_telephone_event(char *fmtpVal)
{
size_t len = PL_strlen(fmtpVal);
size_t len = fmtpVal ? strlen(fmtpVal) : 0;
// make sure the basics are good:
// - at least 1 character
@ -482,7 +482,7 @@ static sdp_result_e sdp_verify_attr_fmtp_telephone_event(char *fmtpVal)
char *temp = PL_strtok_r(dtmf_tones, ",", &strtok_state);
while (temp != NULL) {
len = PL_strlen(temp);
len = strlen(temp);
if (len > 5) {
// an example of a max size token is "11-15", so if the
// token is longer than 5 it is bad

Просмотреть файл

@ -38,7 +38,6 @@ CacheHash::Hash(const char *aData, uint32_t aSize, uint32_t aInitval)
const uint8_t *k = reinterpret_cast<const uint8_t*>(aData);
uint32_t a, b, c, len;
// length = PL_strlen(key);
/* Set up the internal state */
len = aSize;
a = b = 0x9e3779b9; /* the golden ratio; an arbitrary value */

Просмотреть файл

@ -9,7 +9,6 @@
#include "nsComponentManagerUtils.h"
#include "nsIMutableArray.h"
#include "plstr.h"
#include <glib.h>
#define DLADM_STRSIZE 256
@ -50,7 +49,8 @@ do_parse_str(char *bssid_str, char *essid_str, char *strength)
if (ap) {
ap->setMac(mac_as_int);
ap->setSignal(signal);
ap->setSSID(essid_str, PL_strnlen(essid_str, DLADM_STRSIZE));
size_t len = essid_str ? strnlen(essid_str, DLADM_STRSIZE) : 0;
ap->setSSID(essid_str, len);
}
return ap;
}

Просмотреть файл

@ -86,7 +86,7 @@ DoOCSPRequest(const UniquePLArenaPool& arena, const char* url,
if (!arena.get() || !url || !encodedRequest || !encodedRequest->data) {
return Result::FATAL_ERROR_INVALID_ARGS;
}
uint32_t urlLen = PL_strlen(url);
uint32_t urlLen = strlen(url);
if (urlLen > static_cast<uint32_t>(std::numeric_limits<int32_t>::max())) {
return Result::FATAL_ERROR_INVALID_ARGS;
}