Merge rgagnon's pedantic string changes (apps n-z) (bug #2038)
[asterisk/asterisk.git] / apps / app_setcidnum.c
index 9aef3ba..b96330e 100755 (executable)
@@ -73,7 +73,7 @@ static int setcallerid_exec(struct ast_channel *chan, void *data)
                        strncpy(newcid, n, sizeof(newcid) - 1);
                }
        } else
-               strncpy(newcid, tmp, sizeof(newcid));
+               strncpy(newcid, tmp, sizeof(newcid) - 1);
        ast_set_callerid(chan, !ast_strlen_zero(newcid) ? newcid : NULL, anitoo);
        LOCAL_USER_REMOVE(u);
        return res;