From 30987c4f0a2601b75c3076f9332fb64fe50ff822 Mon Sep 17 00:00:00 2001
From: "Jeffrey C. Ollie" <jeff@ocjtech.us>
Date: Fri, 14 Oct 2011 11:21:26 -0500
Subject: [PATCH 5/6] Change cli_complete to avoid compilation error:
error: assignment of read-only location '*lf->cursor'
---
main/asterisk.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/main/asterisk.c b/main/asterisk.c
index f41d788..57c84e7 100644
--- a/main/asterisk.c
+++ b/main/asterisk.c
@@ -2501,7 +2501,7 @@ static char *cli_complete(EditLine *editline, int ch)
int mlen = 0, maxmbuf = 2048;
/* Start with a 2048 byte buffer */
if (!(mbuf = ast_malloc(maxmbuf))) {
- lf->cursor[0] = savechr;
+ *(char *)lf->cursor = savechr;
return (char *)(CC_ERROR);
}
snprintf(buf, sizeof(buf), "_COMMAND MATCHESARRAY \"%s\" \"%s\"", lf->buffer, ptr);
@@ -2513,7 +2513,7 @@ static char *cli_complete(EditLine *editline, int ch)
/* Every step increment buffer 1024 bytes */
maxmbuf += 1024;
if (!(mbuf = ast_realloc(mbuf, maxmbuf))) {
- lf->cursor[0] = savechr;
+ *(char *)lf->cursor = savechr;
return (char *)(CC_ERROR);
}
}
@@ -2575,7 +2575,7 @@ static char *cli_complete(EditLine *editline, int ch)
ast_free(matches);
}
- lf->cursor[0] = savechr;
+ *(char *)lf->cursor = savechr;
return (char *)(long)retval;
}
--
1.7.6.4