src/share/instrument/PathCharsValidator.c
Print this page
rev 9508 : 8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
Reviewed-by:
*** 44,69 ****
static jlong L_PATH;
static jlong H_PATH;
/* Compute the low-order mask for the characters in the given string */
static jlong lowMask(char* s) {
! int n = strlen(s);
jlong m = 0;
! int i;
for (i = 0; i < n; i++) {
int c = (int)s[i];
if (c < 64)
m |= ((jlong)1 << c);
}
return m;
}
/* Compute the high-order mask for the characters in the given string */
static jlong highMask(char* s) {
! int n = strlen(s);
jlong m = 0;
! int i;
for (i = 0; i < n; i++) {
int c = (int)s[i];
if ((c >= 64) && (c < 128))
m |= ((jlong)1 << (c - 64));
}
--- 44,69 ----
static jlong L_PATH;
static jlong H_PATH;
/* Compute the low-order mask for the characters in the given string */
static jlong lowMask(char* s) {
! size_t n = strlen(s);
jlong m = 0;
! size_t i;
for (i = 0; i < n; i++) {
int c = (int)s[i];
if (c < 64)
m |= ((jlong)1 << c);
}
return m;
}
/* Compute the high-order mask for the characters in the given string */
static jlong highMask(char* s) {
! size_t n = strlen(s);
jlong m = 0;
! size_t i;
for (i = 0; i < n; i++) {
int c = (int)s[i];
if ((c >= 64) && (c < 128))
m |= ((jlong)1 << (c - 64));
}
*** 166,176 ****
/*
* Validates that the given URI path component does not contain any
* illegal characters. Returns 0 if only validate characters are present.
*/
int validatePathChars(const char* path) {
! int i, n;
/* initialize on first usage */
if (L_HEX == 0) {
initialize();
}
--- 166,176 ----
/*
* Validates that the given URI path component does not contain any
* illegal characters. Returns 0 if only validate characters are present.
*/
int validatePathChars(const char* path) {
! size_t i, n;
/* initialize on first usage */
if (L_HEX == 0) {
initialize();
}