From 522b44b7bdc212aa15484f45a3d2c90eb9c40498 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C5=81ukasz=20Nowak?= <luke@nexedi.com>
Date: Wed, 1 Sep 2010 03:33:43 +0000
Subject: [PATCH]  - another patch for memcached

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@38084 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 ...rray-subscript-is-above-array-bounds.patch | 25 +++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 patches/memcached-1.4-fix-array-subscript-is-above-array-bounds.patch

diff --git a/patches/memcached-1.4-fix-array-subscript-is-above-array-bounds.patch b/patches/memcached-1.4-fix-array-subscript-is-above-array-bounds.patch
new file mode 100644
index 0000000000..8b8af2679a
--- /dev/null
+++ b/patches/memcached-1.4-fix-array-subscript-is-above-array-bounds.patch
@@ -0,0 +1,25 @@
+Took originally from OpenSuse spec. Needed on opensuse to avoid "error: array subscript is above array bounds"
+--- memcached-orig/memcached.c
++++ memcached-new/memcached.c	2010/05/06 11:40:56
+@@ -2335,15 +2335,18 @@
+ inline static void process_stats_detail(conn *c, const char *command) {
+     assert(c != NULL);
+ 
+-    if (strcmp(command, "on") == 0) {
++    char on[] = "on";
++    char off[] = "off";
++    char dump[] = "dump";
++    if (strcmp(command, on) == 0) {
+         settings.detail_enabled = 1;
+         out_string(c, "OK");
+     }
+-    else if (strcmp(command, "off") == 0) {
++    else if (strcmp(command, off) == 0) {
+         settings.detail_enabled = 0;
+         out_string(c, "OK");
+     }
+-    else if (strcmp(command, "dump") == 0) {
++    else if (strcmp(command, dump) == 0) {
+         int len;
+         char *stats = stats_prefix_dump(&len);
+         write_and_free(c, stats, len);
-- 
2.30.9