From 3f142f0718b393bbd0ac3150ec45c06a97cbeca3 Mon Sep 17 00:00:00 2001 From: oliverschmidt Date: Sun, 31 Jan 2010 23:46:19 +0000 Subject: [PATCH] Convert '@' correctly from PETSCII to ASCII - by leaving it alone. --- core/lib/petsciiconv.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/core/lib/petsciiconv.c b/core/lib/petsciiconv.c index 58b598914..93056fefc 100644 --- a/core/lib/petsciiconv.c +++ b/core/lib/petsciiconv.c @@ -29,7 +29,7 @@ * * This file is part of the Contiki desktop environment for the C64. * - * $Id: petsciiconv.c,v 1.1 2006/06/17 22:41:18 adamdunkels Exp $ + * $Id: petsciiconv.c,v 1.2 2010/01/31 23:46:19 oliverschmidt Exp $ * */ @@ -89,15 +89,17 @@ petsciiconv_toascii(char *buf, unsigned int len) c = 0x0d; } else if(c == 0x0d) { c = 0x0a; - } - switch (c & 0xe0) { - case 0x40: - case 0x60: - c ^= 0x20; - break; - case 0xc0: - c ^= 0x80; - break; + } + if(c != 0x40) { + switch (c & 0xe0) { + case 0x40: + case 0x60: + c ^= 0x20; + break; + case 0xc0: + c ^= 0x80; + break; + } } *ptr = c & 0x7f; ++ptr;