Fix the string copy error 64/147964/1 accepted/tizen/unified/20170907.060340 submit/tizen/20170907.004521
authorjungkon.kim <jungkon.kim@samsung.com>
Wed, 6 Sep 2017 06:39:21 +0000 (15:39 +0900)
committerjungkon.kim <jungkon.kim@samsung.com>
Wed, 6 Sep 2017 06:39:28 +0000 (15:39 +0900)
Change-Id: If307b38556e0760b359264d4a3a87ff11abb4708

common/src/pg_strlcpy.c

index d00139a..09b5200 100644 (file)
@@ -31,7 +31,7 @@ void pg_strlcpy(char *dst, const char *src, size_t dstsize)
                return;
        }
        if (dstsize > 0) {
-               strncpy(dst, src, dstsize - 1);
-               dst[dstsize - 1] = '\0';
+               strncpy(dst, src, dstsize);
+               dst[dstsize] = '\0';
        }
 }