#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "amath.h"

#define BUF_SIZE	1024

int main(int argc, char *argv[])
{
	char buffer[BUF_SIZE];
	char *content = "";

	while (fgets(buffer, BUF_SIZE, stdin))
		asprintf(&content, "%s%s", content, buffer);

	char *result = amath_to_mathml(content);
	printf("<math xmlns=\"http://www.w3.org/1998/Math/MathML\">%s</math>", result);

	if (strlen(result) > 0) free(result);
	if (strlen(content) > 0) free(content);
}

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "amath.h"

#define BUF_SIZE	1024

int main(int argc, char *argv[])
{
	char buffer[BUF_SIZE];
	char *content = "";

	while (fgets(buffer, BUF_SIZE, stdin))
		asprintf(&content, "%s%s", content, buffer);

	char *result = amath_to_mathml(content);
	printf("<math>%s</math>", result);

	if (strlen(result) > 0) free(result);
	if (strlen(content) > 0) free(content);
}

--- 
+++ 
@@ -14,7 +14,7 @@
 		asprintf(&content, "%s%s", content, buffer);
 
 	char *result = amath_to_mathml(content);
-	printf("<math>%s</math>", result);
+	printf("<math xmlns=\"http://www.w3.org/1998/Math/MathML\">%s</math>", result);
 
 	if (strlen(result) > 0) free(result);
 	if (strlen(content) > 0) free(content);
Add XML namespace to math element

The MathML XML namespace isn't needed in context of HTML5 (and I find it a bit verbose), but are used in other applications, e.g. LibreOffice's "Import MathML from Clipboard". Probably should be an command line argument.