Use SEEK_SET instead of literal 0 in lseek calls.
authorYann Dirson <ydirson@free.fr>
Wed, 19 Feb 2014 22:10:05 +0000 (23:10 +0100)
committerYann Dirson <ydirson@free.fr>
Sat, 22 Feb 2014 09:44:45 +0000 (10:44 +0100)
gnushogi/book.c

index 6df98e6..423749f 100644 (file)
@@ -593,7 +593,7 @@ static ULONG currentoffset;
 
 #define WriteAdmin() \
 { \
-  lseek(gfd, 0, 0); \
+  lseek(gfd, 0, SEEK_SET); \
   write(gfd, (char *)&ADMIN, sizeof_gdxadmin); \
 }
 
@@ -601,7 +601,7 @@ static ULONG currentoffset;
 { \
   if (mustwrite ) \
   { \
-    lseek(gfd, currentoffset, 0); \
+    lseek(gfd, currentoffset, SEEK_SET); \
     write(gfd, (char *)&DATA, sizeof_gdxdata); \
     mustwrite = false; \
   } \
@@ -609,13 +609,13 @@ static ULONG currentoffset;
 
 static int ReadAdmin(void)
 {
-    lseek(gfd, 0, 0);
+    lseek(gfd, 0, SEEK_SET);
     return (sizeof_gdxadmin == read(gfd, (char *)&ADMIN, sizeof_gdxadmin));
 }
 
 static int ReadData(struct gdxdata *DATA)
 {
-    lseek(gfd, currentoffset, 0);
+    lseek(gfd, currentoffset, SEEK_SET);
     return (sizeof_gdxdata == read(gfd, (char *)DATA, sizeof_gdxdata));
 }