trivial diff: fix off-by-one errors in examples

Fergus Henderson fjh at cs.mu.OZ.AU
Sat Feb 20 10:39:20 AEDT 1999


Estimated hours taken: 0.1

doc/reference_manual.texi:
	Fix some off-by-one errors in the code examples
	for the use of nondet `pragma c_code'.
	Thanks to Juergen Stuber <juergen at mpi-sb.mpg.de>
	for pointing out the errors.

Index: doc/reference_manual.texi
===================================================================
RCS file: /home/mercury1/repository/mercury/doc/reference_manual.texi,v
retrieving revision 1.124
diff -u -r1.124 reference_manual.texi
--- reference_manual.texi	1999/02/19 23:33:15	1.124
+++ reference_manual.texi	1999/02/19 23:36:43
@@ -3587,7 +3587,7 @@
                 int state;
         "),
         first_code("
-                LOCALS->state = 0;
+                LOCALS->state = 1;
         "),
         retry_code("
                 LOCALS->state++;
@@ -3631,7 +3631,7 @@
         "),
         common_code("
                 S1 = copy_substring(LOCALS->s, 0, LOCALS->count);
-                S2 = copy_substring(LOCALS->s, LOCALS->count + 1,
+                S2 = copy_substring(LOCALS->s, LOCALS->count,
                                                LOCALS->len);
                 if (LOCALS->count < LOCALS->len) @{
                         SUCCEED;

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "Binaries may die
WWW: <http://www.cs.mu.oz.au/~fjh>  |   but source code lives forever"
PGP: finger fjh at 128.250.37.3        |     -- leaked Microsoft memo.



More information about the developers mailing list