Add test for CLIENT_EARLY_TRAFFIC_SECRET key logging
[openssl.git] / test / testutil / stanza.c
index 46b1e770bfddd3b7b702f533918eaec3e9219a0f..09fc18108079194f0a70d347095b081012bada95 100644 (file)
 #include <string.h>
 #include <ctype.h>
 
-#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;
 }