Subject: bin/7988: [PATCH] Boggle: use symbolic name for SEEK_SET
To: None <gnats-bugs@gnats.netbsd.org>
From: Joseph Myers <jsm28@cam.ac.uk>
List: netbsd-bugs
Date: 07/14/1999 10:31:56
>Number:         7988
>Category:       bin
>Synopsis:       [PATCH] Boggle: use symbolic name for SEEK_SET
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Jul 14 10:05:03 1999
>Last-Modified:
>Originator:     Joseph S. Myers
>Organization:
Trinity College, University of Cambridge, UK
>Release:        NetBSD-current of 1999-06-28
>Environment:
[
System: Linux decomino 2.2.10 #1 Mon Jun 14 07:48:53 UTC 1999 i686 unknown
Architecture: i686
]
>Description:

The patch below makes boggle(6) use the symbolic name SEEK_SET for
values which end up as the third argument of fseek(), rather than a
hard-coded 0.

>How-To-Repeat:

>Fix:

diff -ruN boggle/boggle/bog.c boggle+/boggle/bog.c
--- boggle/boggle/bog.c	Sun Aug 30 11:05:06 1998
+++ boggle+/boggle/bog.c	Wed Jul 14 16:02:43 1999
@@ -501,7 +501,7 @@
 	char *q, *w;
 
 	j = word[0] - 'a';
-	if (dictseek(dictfp, dictindex[j].start, 0) < 0) {
+	if (dictseek(dictfp, dictindex[j].start, SEEK_SET) < 0) {
 		(void) fprintf(stderr, "Seek error\n");
 		cleanup();
 		exit(1);
@@ -541,7 +541,7 @@
 	prevch ='a';
 	qi = &wordpath[MAXWORDLEN + 1];
 
-	(void) dictseek(dictfp, 0L, 0);
+	(void) dictseek(dictfp, 0L, SEEK_SET);
 	while ((w = nextword(dictfp)) != NULL) {
 		if (wordlen < minlength)
 			continue;
@@ -568,7 +568,7 @@
 			 */
 			if (i != previndex + 1) {
 				if (dictseek(dictfp,
-				    dictindex[i].start, 0) < 0) {
+				    dictindex[i].start, SEEK_SET) < 0) {
 					warnx("seek error in checkdict()");
 					cleanup();
 					exit(1);
>Audit-Trail:
>Unformatted: