forked from poz/modfetch
9RUTJM039a\\IBTDQB5bQC7Lc8;R;RZF]T@ED0FFBQ?\\G;9[?L0S<^B7@45YH8UU91]QNG<cMLC_K3F[TN5Y8KIUK8Q?M]9ADEWFE\x91W3H²Àow;½MG{d?\x81¸\x96XnbDK<sQm¥B5<{5\x9cGH?¯\xadj¤W\x84E«·[]\x85[q<kxe\x9e|j·I\x85¹\x9c¹D¤t\x81YÀ\\s>´}\x94\x9fOo6\x9b·\x9a\\w\x81tW]³81
\x92VMW>K
This commit is contained in:
parent
6104ed8199
commit
f1a28fb6b4
1 changed files with 32 additions and 32 deletions
|
@ -18,7 +18,7 @@ uint8_t version_patch(void) { return 0; }
|
||||||
const char *module_name(void) { return "sep"; }
|
const char *module_name(void) { return "sep"; }
|
||||||
|
|
||||||
static size_t length = 8;
|
static size_t length = 8;
|
||||||
static char *sep_char = (char[]){'-', '\0'};
|
static char *sep_char = "-";
|
||||||
static size_t sep_char_length = 1;
|
static size_t sep_char_length = 1;
|
||||||
|
|
||||||
void init(char **config) {
|
void init(char **config) {
|
||||||
|
@ -35,7 +35,7 @@ void init(char **config) {
|
||||||
|
|
||||||
if (*value != 0) { // todo: see if there are any more characters that should be rejected
|
if (*value != 0) { // todo: see if there are any more characters that should be rejected
|
||||||
sep_char_length = strlen(value);
|
sep_char_length = strlen(value);
|
||||||
sep_char = malloc((sep_char_length + 1) * sizeof(*sep_char));
|
sep_char = malloc((sep_char_length + 1) * sizeof(char));
|
||||||
strncpy(sep_char, value, sep_char_length);
|
strncpy(sep_char, value, sep_char_length);
|
||||||
sep_char[sep_char_length] = '\0';
|
sep_char[sep_char_length] = '\0';
|
||||||
} else {
|
} else {
|
||||||
|
@ -49,12 +49,12 @@ const char *get(void) {
|
||||||
char *ret;
|
char *ret;
|
||||||
|
|
||||||
if (sep_char == NULL) {
|
if (sep_char == NULL) {
|
||||||
ret = malloc(1 * sizeof(*ret));
|
ret = malloc(1 * sizeof(char));
|
||||||
*ret = 0;
|
*ret = 0;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = malloc((length * sep_char_length + 1) * sizeof(*ret));
|
ret = malloc((length * sep_char_length + 1) * sizeof(char));
|
||||||
memset(ret, 0, length * sep_char_length + 1);
|
memset(ret, 0, length * sep_char_length + 1);
|
||||||
|
|
||||||
for (size_t i = 0; i < length; i++)
|
for (size_t i = 0; i < length; i++)
|
||||||
|
|
Loading…
Reference in a new issue