* memrchr.c (memrchr): Not all compilers allow initializing based on a
authorDavid Shaw <dshaw@jabberwocky.com>
Wed, 22 Jun 2005 20:05:21 +0000 (20:05 +0000)
committerDavid Shaw <dshaw@jabberwocky.com>
Wed, 22 Jun 2005 20:05:21 +0000 (20:05 +0000)
variable that is also being initialized.  Noted by Nelson H. F. Beebe.

util/ChangeLog
util/memrchr.c

index a8baa5c..6b6f6ed 100644 (file)
@@ -1,3 +1,9 @@
+2005-06-22  David Shaw  <dshaw@jabberwocky.com>
+
+       * memrchr.c (memrchr): Not all compilers allow initializing based
+       on a variable that is also being initialized.  Noted by Nelson
+       H. F. Beebe.
+
 2005-06-21  David Shaw  <dshaw@jabberwocky.com>
 
        * http.c (send_request, http_open, http_open_document): Pass in
index fafce10..5621f73 100644 (file)
@@ -33,7 +33,9 @@
 void *
 memrchr(const void *s, int c, size_t n)
 {
-  const unsigned char *start=s,*end=s+n-1;
+  const unsigned char *start=s,*end=s;
+
+  end+=n-1;
 
   while(end>=start)
     {