Fix turn off for empty message
Always failed with an empty message, due to misuse of fwrite().
Broken in commit df7dc203
, v4.2.20.
This commit is contained in:
parent
cfa0838977
commit
421119e1f1
1 changed files with 2 additions and 2 deletions
|
@ -111,8 +111,8 @@ turn(void)
|
|||
memset(&tgm, 0, sizeof(tgm));
|
||||
time(&tgm.tel_date);
|
||||
tgm.tel_length = len;
|
||||
if ((fwrite(&tgm, sizeof(tgm), 1, fptr) != 1) ||
|
||||
(fwrite(msgbuf, tgm.tel_length, 1, fptr) != 1)) {
|
||||
if (fwrite(&tgm, sizeof(tgm), 1, fptr) != 1 ||
|
||||
fwrite(msgbuf, 1, tgm.tel_length, fptr) != tgm.tel_length) {
|
||||
fclose(fptr);
|
||||
pr("Something went wrong writing the message file.\n");
|
||||
logerror("Could not properly write message file (%s).\n",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue