Avoid shadowing.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17575 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -288,7 +288,7 @@ parse_pem_file(hx509_context context,
|
|||||||
void *data = NULL;
|
void *data = NULL;
|
||||||
size_t len = 0;
|
size_t len = 0;
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
int i, ret;
|
int ret;
|
||||||
FILE *f;
|
FILE *f;
|
||||||
|
|
||||||
|
|
||||||
@@ -307,6 +307,7 @@ parse_pem_file(hx509_context context,
|
|||||||
|
|
||||||
while (fgets(buf, sizeof(buf), f) != NULL) {
|
while (fgets(buf, sizeof(buf), f) != NULL) {
|
||||||
char *p;
|
char *p;
|
||||||
|
int i;
|
||||||
|
|
||||||
i = strcspn(buf, "\n");
|
i = strcspn(buf, "\n");
|
||||||
if (buf[i] == '\n') {
|
if (buf[i] == '\n') {
|
||||||
@@ -352,6 +353,7 @@ parse_pem_file(hx509_context context,
|
|||||||
break;
|
break;
|
||||||
case INDATA:
|
case INDATA:
|
||||||
indata:
|
indata:
|
||||||
|
|
||||||
if (strncmp("-----END ", buf, 9) == 0) {
|
if (strncmp("-----END ", buf, 9) == 0) {
|
||||||
where = DONE;
|
where = DONE;
|
||||||
break;
|
break;
|
||||||
@@ -370,13 +372,13 @@ parse_pem_file(hx509_context context,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (where == DONE) {
|
if (where == DONE) {
|
||||||
int i;
|
int j;
|
||||||
|
|
||||||
ret = EINVAL;
|
ret = EINVAL;
|
||||||
for (i = 0; i < sizeof(formats)/sizeof(formats[0]); i++) {
|
for (j = 0; j < sizeof(formats)/sizeof(formats[0]); j++) {
|
||||||
const char *p = formats[i].name;
|
const char *q = formats[j].name;
|
||||||
if (strncmp(type, p, strlen(p)) == 0)
|
if (strncmp(type, q, strlen(q)) == 0)
|
||||||
ret = (*formats[i].func)(context, c, headers, data, len);
|
ret = (*formats[j].func)(context, c, headers, data, len);
|
||||||
}
|
}
|
||||||
free(data);
|
free(data);
|
||||||
data = NULL;
|
data = NULL;
|
||||||
@@ -455,16 +457,16 @@ file_init(hx509_context context,
|
|||||||
|
|
||||||
if (!found_data) {
|
if (!found_data) {
|
||||||
size_t length;
|
size_t length;
|
||||||
void *data;
|
void *ptr;
|
||||||
|
|
||||||
ret = _hx509_map_file(p, &data, &length, NULL);
|
ret = _hx509_map_file(p, &ptr, &length, NULL);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
hx509_clear_error_string(context);
|
hx509_clear_error_string(context);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = parse_certificate(context, c, NULL, data, length);
|
ret = parse_certificate(context, c, NULL, ptr, length);
|
||||||
_hx509_unmap_file(data, length);
|
_hx509_unmap_file(ptr, length);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user