--- pgp/src/language.c 2018/04/24 16:38:31 1.1.1.2 +++ pgp/src/language.c 2018/04/24 16:40:03 1.1.1.4 @@ -12,6 +12,8 @@ #include "fileio.h" #include "language.h" #include "pgp.h" +#include "charset.h" +#include "armor.h" #define SUBTITLES_FILE "language.txt" #define LANG_INDEXFILE "language.idx" @@ -108,7 +110,14 @@ readstr (FILE *f, char *buf, int nlabort case '\\': *p++ = c; break; case '\n': break; case '0': - d = 0; + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + d = c - '0'; while ((c = fgetc(f)) >= '0' && c <= '7') d = 8 * d + c - '0'; *p++ = d; @@ -192,10 +201,9 @@ static int nmsg = 0; static FILE *langf; -static void init_lang(); +static void init_lang(void); + static int make_indexfile(char *); -word32 crcupdate(byte, word32); -void init_crc(); /* * uses 24-bit CRC function from armor.c @@ -203,11 +211,7 @@ void init_crc(); static word32 message_crc(char *s) { - word32 crc = 0; - - while (*s) - crc = crcupdate(*s++, crc); - return(crc); + return crcbytes((byte *)s, strlen(s), (word32)0); } /*