fixed bug in alphabetize()

This commit is contained in:
Florian Stecker 2017-01-31 16:29:03 +01:00
parent efd8e621ea
commit 91377101ff

View File

@ -21,9 +21,11 @@ static char* alphabetize(weylgroup_element_t *e, char *str)
{ {
if(e->wordlength == 0) if(e->wordlength == 0)
sprintf(str, "1"); sprintf(str, "1");
else else {
for(int j = 0; j < e->wordlength; j++) for(int j = 0; j < e->wordlength; j++)
sprintf(str, "%c", e->word[j] + 'a'); str[j] = e->word[j] + 'a';
str[e->wordlength] = 0;
}
return str; return str;
} }