From ba5534fdc100d9dbd586f3e47ee61bb2e0d9e0e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Nut=CC=A6iu?= Date: Sat, 16 Apr 2016 00:56:38 +0300 Subject: [PATCH] Finishing problem 1 for good --- lab8/1.c | 8 ++++---- lab8/libcipher.a | Bin 1416 -> 1416 bytes 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lab8/1.c b/lab8/1.c index 3e8771c..60abdc8 100755 --- a/lab8/1.c +++ b/lab8/1.c @@ -39,7 +39,7 @@ void encrypt_file(char * filename, u8 * password) { } long read = 0; u8 * buffer = read_from_file(in, &read); - for (int i = 0; i <= read/8; i++) { + for (int i = 0; i < read/8; i++) { encrypt(buffer+i*8, password); } @@ -60,7 +60,7 @@ void decrypt_file(char * filename, u8 * password) { long read = 0; u8 * buffer = read_from_file(in, &read); - for (int i = 0; i <= read/8; i++) { + for (int i = 0; i < read/8; i++) { decrypt(buffer+i*8, password); } @@ -85,8 +85,8 @@ int main (int argc, char *argv[]) { return 0; } u8 inputKey[strlen(password) - 1]; - int i = 0; - for (; password[i]; i++) { + + for (int i = 0; password[i]; i++) { inputKey[i] = password[i]; } diff --git a/lab8/libcipher.a b/lab8/libcipher.a index e04368035dcc38b41a50cf4504a4096ef8271f9d..5af7922c4a0f63d66c6793f659d6991ed00fb759 100644 GIT binary patch delta 23 ccmeC+?%S2N3`O