-
Notifications
You must be signed in to change notification settings - Fork 4
Description
BUG in main.asm
main.asm have a bug: When a char is encrypted to '\0', there is a problem happens when we copy teaOut to teaIn again for decryption because Str_copy copys characters till it finds a '\0' so the teaOut is not fully copied back to teaIn in this case.
Failed test case:
input: MACBETH. My dearest love, Duncan comes here tonight. LADY MACBETH. And when goes hence? MACBETH. Tomorrow, as he purposes. LADY MACBETH.
Enter Key 1: 7
Enter Key 2: 8
Enter Key 3: 9
Enter Key 4: 0
-------------------------------------------------------------------------------------------------------------------------
Program Output:
Encrypted: ╤;╘ûطQ▼s�<Rn╩n"ئnص²ظp├╕ٌّDû╨╗fo┴¤ئ├╖%"╪�►└3Q▼╧┬■Z ≡▼ⁿ╟�7ُئcS╙%╢/اْrف▐▄عu╔ô╜ë/╤;╘ûط~Q▼
┼→¤ ?<eء:ص#كِs√(z5ًB╬
VV-H4J≡}g �.cصطyٌë�ê╤;╘ûط
Decrypted: MACBETH. My dearest love, Duncan comes here tonight. LADY MACBET∙↑┘'3îّTb
UPr▬إ%
«رt►ج▼1ع~دس≡#\VP╫ب£▀ْ5╥▒╩��
-------------------------------------------------------------------------------------------------------------------------
Expected Output:
Encrypted: ╤;╘ûطQ▼s�<Rn╩n"ئnص²ظp├╕ٌّDû╨╗fo┴¤ئ├╖%"╪�►└3Q▼╧┬■Z ≡▼ⁿ╟�7ُئcS╙%╢/اْrف▐▄عu╔ô╜ë/╤;╘ûط~Q▼
┼→¤ ?<eء:ص#كِs√(z5ًB╬
V V-H4J≡}g �.cصطyٌë�ê╤;╘ûط
Decrypted: MACBETH. My dearest love, Duncan comes here tonight. LADY MACBETH. And when goes hence? MACBETH. Tomorrow, as he purposes. LADY MACBETH.