Bug fixes

This commit is contained in:
Stephen Cochrane 2020-05-03 19:23:19 +02:00
parent 47ebc09660
commit 8e2e542514

View File

@ -79,12 +79,15 @@ void genBP(char *file) {
void echoFile(FILE *fp) { void echoFile(FILE *fp) {
char line[256] = ""; char line[256] = "";
char cat[2];
ch = getc(fp); ch = getc(fp);
printf("Echo file\n"); printf("Echo file\n");
while (ch != EOF) { while (ch != EOF) {
if (ch != '\n') { if (ch != '\n') {
strcat(line, &ch); cat[0] = ch;
cat[1] = '\0';
strcat(line, cat);
} else { } else {
printf("%s\n", line); printf("%s\n", line);
sprintf(line, ""); sprintf(line, "");
@ -104,6 +107,7 @@ void parseBox() {
char *tb = "+-------------------------------------------------------+\n"; char *tb = "+-------------------------------------------------------+\n";
char *empty = "| |\n"; char *empty = "| |\n";
char line[256]; char line[256];
char cat[2];
append_html(tb); append_html(tb);
append_html(empty); append_html(empty);
@ -119,7 +123,9 @@ void parseBox() {
append_html("| "); append_html("| ");
} else if ( i < 47) { } else if ( i < 47) {
//print char //print char
append_html(&ch); cat[0] = ch;
cat[1] = '\0';
append_html(cat);
next(); next();
} else { } else {
//setup newline //setup newline