write to file

This commit is contained in:
Alexander Popov 2023-07-30 00:55:11 +03:00
parent 9326e6e09a
commit 6bf29bf316
Signed by: iiiypuk
GPG Key ID: E47FE0AB36CD5ED6

View File

@ -65,6 +65,9 @@ int main(int argc, char **argv) {
signal(SIGINT, handle_sigint);
FILE *output_file;
output_file = fopen("./abc.txt", "w");
/* Reading lines from serial port. */
bool reading = true;
while (reading && !INTERRUPT) {
@ -94,8 +97,10 @@ int main(int argc, char **argv) {
}
puts(buffer);
fputs(buffer, output_file);
}
fclose(output_file);
free(buffer);
return 0;