From: Olaf Wintermann Date: Fri, 18 Apr 2025 18:31:15 +0000 (+0200) Subject: fix wrong resource id parameter in qthr_save_attachment X-Git-Url: https://uap-core.de/gitweb/?a=commitdiff_plain;h=25df5c3e2bcc77df8924ccad7478ccfcd621c6e4;p=note.git fix wrong resource id parameter in qthr_save_attachment --- diff --git a/application/store.c b/application/store.c index a434e74..71f968f 100644 --- a/application/store.c +++ b/application/store.c @@ -639,17 +639,16 @@ static int qthr_save_attachment(SaveAttachmentJob *job) { job->error = 1; } else { DBUResult *result = dbuQueryGetResult(q); - int64_t resource_id; - if(dbuResultAsInt64(result, &resource_id)) { + int64_t attachment_resource_id; + if(dbuResultAsInt64(result, &attachment_resource_id)) { job->error = 2; } else { dbuQueryFree(q); q = connection->createQuery(connection, NULL); dbuQuerySetSQL(q, SQL_ATTACHMENT_NEW); - dbuQuerySetParamInt64(q, 1, job->resource_id); + dbuQuerySetParamInt64(q, 1, attachment_resource_id); dbuQuerySetParamInt64(q, 2, job->resource_id); dbuQuerySetParamInt64(q, 3, job->type); - dbuQuerySetParamBytes(q, 4, job->content.ptr, job->content.length); if(dbuQueryExec(q)) { job->error = 3; } else {