From aaa8f6338711835c50202fdb7a9dde75444902f7 Mon Sep 17 00:00:00 2001
From: magnum <magnum>
Date: Fri, 23 Sep 2011 19:20:19 +0200
Subject: [PATCH] j7: sapG trivial bug in set_key

---
 src/sapG_fmt_plug.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/sapG_fmt_plug.c b/src/sapG_fmt_plug.c
index 5e1267b..c2b4e52 100644
--- a/src/sapG_fmt_plug.c
+++ b/src/sapG_fmt_plug.c
@@ -136,10 +136,9 @@ static void sapcodvng_init(struct fmt_main *pFmt)
 static void sapcodvng_set_key(char *key, int index)
 {
 	strnzcpy(saved_key, key, PLAINTEXT_LENGTH + 1);
-	// 0. translate candidates to UTF-8
-	if (options.utf8)
+	if (options.utf8 || options.ascii)
 		strnzcpy((char*)trPassword, key, PLAINTEXT_LENGTH + 1);
-	else if (!options.ascii) {
+	else {
 		// convert from codepage -> Unicode -> UTF-8
 		UTF16 tmp16[PLAINTEXT_LENGTH + 1];
 #if ARCH_LITTLE_ENDIAN
-- 
1.7.4.1

