output.c 674 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
#include "includes/output.h"

void print_line(char *string, char *string2)
{
	int ctr;
	int ctr2;
	char sendbuff[255];
	char timebuff[5];
	char timebuff2[5];
	struct tm *timenow;
	time_t now;

	if ( strlen(outputfile) ){
		memset(sendbuff, '\0', sizeof(sendbuff));
		ctr = 0;
		ctr2 = 0;
                do {
                        if ( string[ctr] == '%' && string[ctr + 1] == 's' ){
				strcat(sendbuff, string2);
				ctr += 2;
                        }
                        sendbuff[strlen(sendbuff)] = string[ctr];
                        ctr ++;
                } while ( string[ctr] != '\0' );
		
		fputs(sendbuff, wfp);
	}

	printf(string, string2);

	return;
}