aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmadeusz Sławiński via OpenBIOS <openbios@openbios.org>2024-04-28 21:11:02 +0200
committerMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2024-09-06 22:19:34 +0100
commit3adb9be95cc798a3df258f912e7ee4a92bd487f5 (patch)
tree33bbc02df3b70bf3b5b367e456a9d3f2d83fca5c
parent62262791948a7880a3b4a40794de79d8a7a767e1 (diff)
downloadopenbios-3adb9be95cc798a3df258f912e7ee4a92bd487f5.zip
openbios-3adb9be95cc798a3df258f912e7ee4a92bd487f5.tar.gz
openbios-3adb9be95cc798a3df258f912e7ee4a92bd487f5.tar.bz2
cuda: fix len calculation in cuda_adb_req
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> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
-rw-r--r--drivers/cuda.c2
1 files changed, 1 insertions, 1 deletions
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);