diff --git a/mongoose.c b/mongoose.c
index 04488bbd6b31096f654f903aa8b9993c9b1ed84b..6bd5581f6dc0785998e1f1091b295acba4caf0e5 100644
--- a/mongoose.c
+++ b/mongoose.c
@@ -3120,7 +3120,8 @@ static void read_from_cgi(struct connection *conn) {
     if (conn->num_bytes_sent == 0 && conn->remote_iobuf.len == 0) {
       // Parse CGI headers, and modify the reply line if needed
       if ((len = get_request_len(buf, n)) > 0) {
-        char *s = buf, *status = NULL, buf2[sizeof(buf)];
+        const char *status = NULL;
+        char *s = buf, buf2[sizeof(buf)];
         struct mg_connection c;
         int i, k;