Skip to content

Commit bd7fcc7

Browse files
author
Rafał Miłecki
committed
pc1crypt: make decrypt/encrypt functions take void * as argument
Make them more generic regarding accepted data buffers. This fixes: src/pc1crypt.c: In function ‘main’: src/pc1crypt.c:322:26: warning: pointer targets in passing argument 2 of ‘pc1_decrypt_buf’ differ in signedness [-Wpointer-sign] pc1_decrypt_buf(&pc1, buf, datalen); ^~~ src/pc1crypt.c:324:26: warning: pointer targets in passing argument 2 of ‘pc1_encrypt_buf’ differ in signedness [-Wpointer-sign] pc1_encrypt_buf(&pc1, buf, datalen); ^~~ Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
1 parent 81db302 commit bd7fcc7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/pc1crypt.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,18 +167,18 @@ static void pc1_init(struct pc1_ctx *pc1)
167167
strcpy(pc1->cle, "Remsaalps!123456");
168168
}
169169

170-
static void pc1_decrypt_buf(struct pc1_ctx *pc1, unsigned char *buf,
171-
unsigned len)
170+
static void pc1_decrypt_buf(struct pc1_ctx *pc1, void *data, unsigned len)
172171
{
172+
unsigned char *buf = data;
173173
unsigned i;
174174

175175
for (i = 0; i < len; i++)
176176
buf[i] = pc1_decrypt(pc1, buf[i]);
177177
}
178178

179-
static void pc1_encrypt_buf(struct pc1_ctx *pc1, unsigned char *buf,
180-
unsigned len)
179+
static void pc1_encrypt_buf(struct pc1_ctx *pc1, void *data, unsigned len)
181180
{
181+
unsigned char *buf = data;
182182
unsigned i;
183183

184184
for (i = 0; i < len; i++)

0 commit comments

Comments
 (0)