From b8f9aeb1a823454c083aa8dd96702680643b74d0 Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Tue, 7 Apr 2015 23:31:41 +0100 Subject: [PATCH] Fix incorrect string termination. --- lib/send_mosq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/send_mosq.c b/lib/send_mosq.c index a0986c0b..8b5b918e 100644 --- a/lib/send_mosq.c +++ b/lib/send_mosq.c @@ -149,7 +149,7 @@ int _mosquitto_send_publish(struct mosquitto *mosq, uint16_t mid, const char *to return MOSQ_ERR_NOMEM; } snprintf(topic_temp, len, "%s%s", cur_topic->remote_prefix, mapped_topic); - cur_topic->remote_prefix[len] = '\0'; + topic_temp[len] = '\0'; _mosquitto_free(mapped_topic); mapped_topic = topic_temp; }