aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--util/ChangeLog6
-rw-r--r--util/memrchr.c4
2 files changed, 9 insertions, 1 deletions
diff --git a/util/ChangeLog b/util/ChangeLog
index a8baa5c37..6b6f6edf5 100644
--- a/util/ChangeLog
+++ b/util/ChangeLog
@@ -1,3 +1,9 @@
+2005-06-22 David Shaw <[email protected]>
+
+ * 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 <[email protected]>
* http.c (send_request, http_open, http_open_document): Pass in
diff --git a/util/memrchr.c b/util/memrchr.c
index fafce1073..5621f7323 100644
--- a/util/memrchr.c
+++ b/util/memrchr.c
@@ -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)
{