mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-24 06:46:22 +00:00
revert: restore pre-upstream-merge baseline (tree of 3b673150b)
Roll the tree back to the pre-merge tip3b673150b, undoing the upstream sync merge72f4f186d(303 files) and the 13 post-merge commits layered on top of it. Purpose: restore the last pre-sync baseline so the reported OMEMO/OTR encryption regressions can be reproduced against a known-good state and the upstream sync ruled in or out as the cause. Nothing is dropped from history; the merge and every post-merge commit remain reachable and can be cherry-picked back selectively. Baseline:3b673150bchore(chatlog): disable background message file logging (stage 1) Undoes merge:72f4f186dmerge: sync upstream profanity-im/profanity
This commit is contained in:
@@ -119,9 +119,10 @@ _create_dir(const char* name)
|
||||
gboolean
|
||||
_mkdir_recursive(const char* dir)
|
||||
{
|
||||
int i;
|
||||
gboolean result = TRUE;
|
||||
|
||||
for (size_t i = 1; i <= strlen(dir); i++) {
|
||||
for (i = 1; i <= strlen(dir); i++) {
|
||||
if (dir[i] == '/' || dir[i] == '\0') {
|
||||
gchar* next_dir = g_strndup(dir, i);
|
||||
result = _create_dir(next_dir);
|
||||
@@ -214,7 +215,7 @@ sleep_ms(int ms)
|
||||
* Read available data from fd into output_buffer with timeout.
|
||||
* Returns number of bytes read, 0 on timeout, -1 on error.
|
||||
*/
|
||||
static ssize_t
|
||||
static int
|
||||
_read_output(int timeout_ms)
|
||||
{
|
||||
fd_set readfds;
|
||||
@@ -231,19 +232,17 @@ _read_output(int timeout_ms)
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Check size before subtracting so OUTPUT_BUF_SIZE - output_len - 1
|
||||
* never goes negative / underflows. Reserves one byte for the
|
||||
* trailing NUL. */
|
||||
if (output_len >= OUTPUT_BUF_SIZE - 1) {
|
||||
size_t space = OUTPUT_BUF_SIZE - output_len - 1;
|
||||
if (space <= 0) {
|
||||
/* Buffer full, shift content */
|
||||
memmove(output_buffer, output_buffer + OUTPUT_BUF_SIZE / 2, OUTPUT_BUF_SIZE / 2);
|
||||
output_len = OUTPUT_BUF_SIZE / 2;
|
||||
space = OUTPUT_BUF_SIZE - output_len - 1;
|
||||
}
|
||||
size_t space = OUTPUT_BUF_SIZE - output_len - 1;
|
||||
|
||||
ssize_t n = read(fd, output_buffer + output_len, space);
|
||||
if (n > 0) {
|
||||
output_len += (size_t)n;
|
||||
output_len += n;
|
||||
output_buffer[output_len] = '\0';
|
||||
}
|
||||
return n;
|
||||
|
||||
Reference in New Issue
Block a user