#include <gnutls/x509.h>
#include <c-ctype.h>
+#define MAX_ELEMENTS 48
+
static void
-break_comma_list(char *etag,
- char **broken_etag, int *elements, int max_elements,
- char sep);
+break_list(char *etag,
+ char *broken_etag[MAX_ELEMENTS], int *size);
/**
* gnutls_cipher_set_priority:
}
-#define MAX_ELEMENTS 48
-
#define LEVEL_NONE "NONE"
#define LEVEL_NORMAL "NORMAL"
#define LEVEL_PFS "PFS"
goto error;
}
- break_comma_list(darg, broken_list, &broken_list_size,
- MAX_ELEMENTS, ':');
+ break_list(darg, broken_list, &broken_list_size);
/* This is our default set of protocol version, certificate types and
* compression methods.
*/
* MAX_COMMA_SEP_ELEMENTS size; Note that the given string is modified.
*/
static void
-break_comma_list(char *etag,
- char **broken_etag, int *elements, int max_elements,
- char sep)
+break_list(char *list,
+ char *broken_list[MAX_ELEMENTS], int *size)
{
- char *p = etag;
- if (sep == 0)
- sep = ',';
+ char *p = list;
- *elements = 0;
+ *size = 0;
do {
- broken_etag[*elements] = p;
+ broken_list[*size] = p;
- (*elements)++;
+ (*size)++;
- p = strchr(p, sep);
+ p = strchr(p, ':');
if (p) {
*p = 0;
p++; /* move to next entry and skip white
p++;
}
}
- while (p != NULL && *elements < max_elements);
+ while (p != NULL && *size < MAX_ELEMENTS);
}
/**