j
: Next unread message k
: Previous unread message j a
: Jump to all threads
j l
: Jump to MailingList overview
When advancing buffer by 1, len should be shorthened by appropriate amount, instead of setting it to -1.
Found with cppcheck.
Signed-off-by: Amadeusz Sławiński amade@asmblr.net --- drivers/cuda.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/cuda.c b/drivers/cuda.c index 86d2ddb..93a935a 100644 --- a/drivers/cuda.c +++ b/drivers/cuda.c @@ -162,7 +162,7 @@ static int cuda_adb_req (void *host, const uint8_t *snd_buf, int len, } } else { pos = buffer + 1; - len = -1; + len -= 1; } memcpy(rcv_buf, pos, len);
On 28/04/2024 20:11, Amadeusz Sławiński via OpenBIOS wrote:
When advancing buffer by 1, len should be shorthened by appropriate amount, instead of setting it to -1.
Found with cppcheck.
Signed-off-by: Amadeusz Sławiński amade@asmblr.net
drivers/cuda.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/cuda.c b/drivers/cuda.c index 86d2ddb..93a935a 100644 --- a/drivers/cuda.c +++ b/drivers/cuda.c @@ -162,7 +162,7 @@ static int cuda_adb_req (void *host, const uint8_t *snd_buf, int len, } } else { pos = buffer + 1;
len = -1;
len -= 1; } memcpy(rcv_buf, pos, len);
Apologies for the delay: this looks correct to me, so I'll queue it for master.
ATB,
Mark.
On 13/07/2024 20:12, Mark Cave-Ayland wrote:
On 28/04/2024 20:11, Amadeusz Sławiński via OpenBIOS wrote:
When advancing buffer by 1, len should be shorthened by appropriate amount, instead of setting it to -1.
Found with cppcheck.
Signed-off-by: Amadeusz Sławiński amade@asmblr.net
drivers/cuda.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/cuda.c b/drivers/cuda.c index 86d2ddb..93a935a 100644 --- a/drivers/cuda.c +++ b/drivers/cuda.c @@ -162,7 +162,7 @@ static int cuda_adb_req (void *host, const uint8_t *snd_buf, int len, } } else { pos = buffer + 1; - len = -1; + len -= 1; } memcpy(rcv_buf, pos, len);
Apologies for the delay: this looks correct to me, so I'll queue it for master.
Applied to master, thanks.
ATB,
Mark.