diff options
author | Michael Ellerman <michael@ellerman.id.au> | 2006-03-21 10:46:08 +0100 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-03-22 05:04:25 +0100 |
commit | 584fc6d111c34a9a2512f6c7652dff29232bf70d (patch) | |
tree | 80d67b3c6902eff8309106be6291dd84a14d8ab7 /arch | |
parent | [PATCH] powerpc: iseries: Make more stuff static in platforms/iseries/mf.c (diff) | |
download | linux-584fc6d111c34a9a2512f6c7652dff29232bf70d.tar.xz linux-584fc6d111c34a9a2512f6c7652dff29232bf70d.zip |
[PATCH] powerpc: Add strne2a() to convert a string from EBCDIC to ASCII
Add strne2a() which converts a string from EBCDIC to ASCII.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/lib/e2a.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/powerpc/lib/e2a.c b/arch/powerpc/lib/e2a.c index 4f88f4cc21e8..4b72ed8fd50e 100644 --- a/arch/powerpc/lib/e2a.c +++ b/arch/powerpc/lib/e2a.c @@ -103,4 +103,14 @@ unsigned char e2a(unsigned char x) } EXPORT_SYMBOL(e2a); +unsigned char* strne2a(unsigned char *dest, const unsigned char *src, size_t n) +{ + int i; + + n = strnlen(src, n); + for (i = 0; i < n; i++) + dest[i] = e2a(src[i]); + + return dest; +} |