From 7ffa781dc39a7274692d8db11043b3a9e92e36ce Mon Sep 17 00:00:00 2001 From: Nanang Izzuddin Date: Tue, 25 Aug 2015 08:45:46 +0000 Subject: Re #1881: Fixed compile warnings on VS2015 about declaration hides previous declaration. git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@5170 74dad513-b988-da41-8d7b-12977e46ad98 --- pjlib/src/pj/errno.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'pjlib/src/pj/errno.c') diff --git a/pjlib/src/pj/errno.c b/pjlib/src/pj/errno.c index dd39e23c..8cf90f3c 100644 --- a/pjlib/src/pj/errno.c +++ b/pjlib/src/pj/errno.c @@ -98,11 +98,11 @@ static int pjlib_error(pj_status_t code, char *buf, pj_size_t size) for (i=0; i= size) len = size-1; - pj_memcpy(buf, err_str[i].msg, len); - buf[len] = '\0'; - return (int)len; + pj_size_t len2 = pj_ansi_strlen(err_str[i].msg); + if (len2 >= size) len2 = size-1; + pj_memcpy(buf, err_str[i].msg, len2); + buf[len2] = '\0'; + return (int)len2; } } #endif -- cgit v1.2.3