Skip to content
Snippets Groups Projects
Commit 785d049f authored by George Kiagiadakis's avatar George Kiagiadakis
Browse files

main: fix call to g_input_stream_read after reaching the end of the buffer

after consuming the whole buffer, cur & linestart need to
be reset to point back to the beginning of the local buffer
parent ac295b10
No related branches found
No related tags found
No related merge requests found
......@@ -324,6 +324,9 @@ parse_commands_file (struct WpDaemonData *d, GInputStream * stream,
strncpy (buffer, linestart, cur - linestart);
linestart = buffer;
cur = buffer + (cur - linestart);
} else {
/* reset for the next g_input_stream_read() call */
linestart = cur = buffer;
}
} while (!eof);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment