Fix some warnings
[xboard.git] / book.c
diff --git a/book.c b/book.c
index 3a764b9..4bc2521 100644 (file)
--- a/book.c
+++ b/book.c
@@ -36,6 +36,7 @@
 
 #include "common.h"
 #include "backend.h"
+#include "moves.h"
 
 #ifdef _MSC_VER
   typedef unsigned __int64 uint64;
@@ -585,7 +586,7 @@ int TextToMoves(char *text, int moveNum, entry_t *entries)
            valid = ParseOneMove(text, moveNum, &moveType, &fromX, &fromY, &toX, &toY, &promoChar);
            text = strstr(text, yy_textstr) + strlen(yy_textstr); // skip what we parsed
            if(!valid || moveType != NormalMove) continue;
-           if(*text == ' ' && sscanf(text+1, "{%d/%d}", &entries[count].learnPoints, &entries[count].learnCount) == 2) {
+           if(*text == ' ' && sscanf(text+1, "{%hd/%hd}", &entries[count].learnPoints, &entries[count].learnCount) == 2) {
                text = strchr(text+1, '}') + 1;
            } else {
                entries[count].learnPoints = 0;