Просмотр исходного кода

Now compiles clean with make CC=gcc CFLAGS='-Wall -Wextra'

Dave Vandervies 17 лет назад
Родитель
Сommit
8d51c1b50e
2 измененных файлов с 2 добавлено и 1 удалено
  1. 1 1
      mnemonic.c
  2. 1 0
      mnemonic.h

+ 1 - 1
mnemonic.c

@@ -255,7 +255,7 @@ mn_decode_word_index (mn_index index, void *dest, int destsize, int *offset)
   if (*offset < 0)		/* Error from previous call? report it */
     return *offset;
 
-  if (index < 0 || index > MN_WORDS)	/* Word index out of range */
+  if (index > MN_WORDS)	/* Word index out of range */
     {
       *offset = MN_EINDEX;
       return *offset;

+ 1 - 0
mnemonic.h

@@ -49,6 +49,7 @@
 
 typedef unsigned char mn_byte;		/* 8 bit quantity */
 typedef unsigned long mn_word32;	/* temporary value, at least 32 bits */
+/* Range checks assume that mn_index is unsigned (=> can't be <0).  --DV */
 typedef unsigned int mn_index;		/* index into wordlist */
 
 extern const char *mn_words[];		/* the word list itself */