$OpenBSD: patch-lingucomponent_source_spellcheck_hunspell_affixmgr_cxx,v 1.4 2007/04/18 13:20:48 kurt Exp $
--- lingucomponent/source/spellcheck/hunspell/affixmgr.cxx.orig.port	Sat Sep 16 12:08:12 2006
+++ lingucomponent/source/spellcheck/hunspell/affixmgr.cxx	Wed Apr 18 03:46:25 2007
@@ -2477,12 +2477,12 @@ char * AffixMgr::suffix_check_twosfx_morph(const char 
                 result3[0] = '\0';
 #ifdef DEBUG
                 unsigned short flag = sptr->getFlag();
-                char flagch[2] = &flag;
                 if (flag_mode == FLAG_NUM) {
-                    sprintf(result3, "%d", sptr->getKey());
+                    sprintf(result3, "%p", sptr->getKey());
                 } else if (flag_mode == FLAG_LONG) {
-                    sprintf(result3, "%c%c", flagch[0], flagch[1]);                
-                } else sprintf(result3, "%c", flagch[1]);                
+                    sprintf(result3, "%c%c", (char)(flag>>8), (char)(flag & 0x00ff));
+                } else sprintf(result3, "%c", (char)(flag & 0x00ff));
+
                 strcat(result3, ":");
 #endif
                 if (sptr->getMorph()) strcat(result3, sptr->getMorph());
@@ -2504,10 +2504,17 @@ char * AffixMgr::suffix_check_morph(const char * word,
        int sfxopts, AffEntry * ppfx, const FLAG cclass, const FLAG needflag, char in_compound)
 {
     char result[MAXLNLEN];
-    
+
+#ifdef DEBUG
+    char result2[MAXLNLEN];
+#endif
+ 
     struct hentry * rv = NULL;
 
     result[0] = '\0';
+#ifdef DEBUG
+    result2[0] = '\0';
+#endif
 
     PfxEntry* ep = (PfxEntry *) ppfx;
 
@@ -2593,13 +2600,12 @@ char * AffixMgr::suffix_check_morph(const char * word,
                         !TESTAFF(rv->astr, lemma_present, rv->alen))) strcat(result, rv->word);
                     if (!complexprefixes && rv->description) strcat(result, rv->description);
 #ifdef DEBUG
-                unsigned short flag = sptr->getKey();
-                char flagch[2] = &flag;
+		unsigned short flag = sptr->getFlag();
                 if (flag_mode == FLAG_NUM) {
-                    sprintf(result2, "%d", sptr->getKey());
+                    sprintf(result2, "%p", sptr->getKey());
                 } else if (flag_mode == FLAG_LONG) {
-                    sprintf(result2, "%c%c", flagch[0], flagch[1]);                
-                } else sprintf(result2, "%c", flagch[1]);                
+                    sprintf(result2, "%c%c", (char)(flag>>8), (char)(flag & 0x00FF));
+                } else sprintf(result2, "%c", (char)(flag & 0x00FF));
                 strcat(result2, ":");
                 strcat(result, result2);
 #endif
