#define print_localized(x) mmd_print_localized_char_odf(out, x, scratch)
+/// strdup() not available on all platforms
+static char * my_strdup(const char * source) {
+ char * result = malloc(strlen(source) + 1);
+
+ if (result) {
+ strcpy(result, source);
+ }
+
+ return result;
+}
+
+
void mmd_print_char_odf(DString * out, char c) {
switch (c) {
case '"':
char *result;
int i;
- result = strdup(original);
+ result = my_strdup(original);
for (i = 0; result[i]; i++)
result[i] = tolower(result[i]);
if (strcmp(temp_char2, "notcited") == 0) {
free(temp_char);
- temp_char = strdup("");
+ temp_char = my_strdup("");
temp_bool = false;
}
} else {
// This is the actual citation (e.g. `[#foo]`)
// No locator
- temp_char = strdup("");
+ temp_char = my_strdup("");
}
// Classify this use