summaryrefslogtreecommitdiff
blob: 8232f80aebbc159600ec86404a2eb38d50313887 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
From 337cc9367a3cb4450eee245c6ceb615d0f05499d Mon Sep 17 00:00:00 2001
From: Alon Bar-Lev <alon.barlev@gmail.com>
Date: Sat, 2 Feb 2013 01:18:08 +0200
Subject: [PATCH 2/2] build: support disable iconv for static build

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
---
 password.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/password.c b/password.c
index 9a2c1f8..dee79da 100644
--- a/src/password.c
+++ b/src/password.c
@@ -232,6 +232,15 @@ int passwd_to_utf16(unsigned char *in_passwd,
     size_t ic_inbytesleft,
            ic_outbytesleft;
 
+#ifdef DISABLE_ICONV
+    /* support only latin */
+    int i;
+    for (i=0;i<length+1;i++) {
+    	out_passwd[i*2] = in_passwd[i];
+	out_passwd[i*2+1] = 0;
+    }
+    return length*2;
+#else
     /* Max length is specified in character, but this function deals
      * with bytes.  So, multiply by two since we are going to create a
      * UTF-16 string.
@@ -273,5 +282,6 @@ int passwd_to_utf16(unsigned char *in_passwd,
     }
     iconv_close(condesc);
     return (max_length - ic_outbytesleft);
+#endif
 }
 
-- 
1.7.12.4