Assignment to 'p' discards the const qualifier. To repair, we need to adapt the local pointer, and the function declaration to match the others.
Signed-off-by: Kieran Bingham <kieranbing...@gmail.com> --- src/winmsgbuf.c | 4 ++-- src/winmsgbuf.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/winmsgbuf.c b/src/winmsgbuf.c index 793e8de..40c817e 100644 --- a/src/winmsgbuf.c +++ b/src/winmsgbuf.c @@ -276,9 +276,9 @@ size_t wmbc_bytesleft(WinMsgBufContext *wmbc) /* Merges the contents of another null-terminated buffer and its renditions. The * return value is a pointer to the first character of WMB's buffer. */ -char *wmbc_mergewmb(WinMsgBufContext *wmbc, WinMsgBuf *wmb) +const char *wmbc_mergewmb(WinMsgBufContext *wmbc, WinMsgBuf *wmb) { - char *p; + const char *p; size_t offset = wmbc_offset(wmbc); int ri; diff --git a/src/winmsgbuf.h b/src/winmsgbuf.h index 81a9fcf..f090d80 100644 --- a/src/winmsgbuf.h +++ b/src/winmsgbuf.h @@ -80,7 +80,7 @@ int wmbc_printf(WinMsgBufContext *, const char *, ...) __attribute__((format(printf,2,3))); size_t wmbc_offset(WinMsgBufContext *); size_t wmbc_bytesleft(WinMsgBufContext *); -char *wmbc_mergewmb(WinMsgBufContext *, WinMsgBuf *); +const char *wmbc_mergewmb(WinMsgBufContext *, WinMsgBuf *); const char *wmbc_finish(WinMsgBufContext *); void wmbc_free(WinMsgBufContext *); -- 2.1.4