X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=test%2Ftestutil%2Fstanza.c;h=09fc18108079194f0a70d347095b081012bada95;hp=46b1e770bfddd3b7b702f533918eaec3e9219a0f;hb=00dfbaad88a69ed8294d6039bf5f7d722f72bf39;hpb=ae269dd8b72dbed1f2c5f92dbe0fbf5b7b905e7b diff --git a/test/testutil/stanza.c b/test/testutil/stanza.c index 46b1e770bf..09fc181080 100644 --- a/test/testutil/stanza.c +++ b/test/testutil/stanza.c @@ -12,15 +12,16 @@ #include #include -#include "e_os.h" +#include "internal/nelem.h" #include "../testutil.h" +#include "tu_local.h" int test_start_file(STANZA *s, const char *testfile) { TEST_info("Reading %s", testfile); set_test_title(testfile); memset(s, 0, sizeof(*s)); - if (!TEST_ptr(s->fp = BIO_new_file(testfile, "rb"))) + if (!TEST_ptr(s->fp = BIO_new_file(testfile, "r"))) return 0; s->test_file = testfile; return 1; @@ -69,12 +70,12 @@ static char *strip_spaces(char *p) char *q; /* Skip over leading spaces */ - while (*p && isspace(*p)) + while (*p && isspace((unsigned char)*p)) p++; if (!*p) return NULL; - for (q = p + strlen(p) - 1; q != p && isspace(*q); ) + for (q = p + strlen(p) - 1; q != p && isspace((unsigned char)*q); ) *q-- = '\0'; return *p ? p : NULL; }