aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorvda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-10-05 22:50:22 +0000
committervda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-10-05 22:50:22 +0000
commit445754ff183de68a177b8482cf6df237bc4d3532 (patch)
tree04ddfef43a09621d9fbe605a4fe89379e7089588 /libbb
parent5ef95285fbe5ef38b62e0960ad45b6678262463c (diff)
downloadbusybox-w32-445754ff183de68a177b8482cf6df237bc4d3532.tar.gz
busybox-w32-445754ff183de68a177b8482cf6df237bc4d3532.tar.bz2
busybox-w32-445754ff183de68a177b8482cf6df237bc4d3532.zip
httpd: add -u user[:grp] support
git-svn-id: svn://busybox.net/trunk/busybox@16313 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'libbb')
-rw-r--r--libbb/safe_strncpy.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libbb/safe_strncpy.c b/libbb/safe_strncpy.c
index add92ac9f..42bc16ea0 100644
--- a/libbb/safe_strncpy.c
+++ b/libbb/safe_strncpy.c
@@ -15,6 +15,7 @@
15/* Like strncpy but make sure the resulting string is always 0 terminated. */ 15/* Like strncpy but make sure the resulting string is always 0 terminated. */
16char * safe_strncpy(char *dst, const char *src, size_t size) 16char * safe_strncpy(char *dst, const char *src, size_t size)
17{ 17{
18 dst[size-1] = '\0'; 18 if (!size) return dst;
19 return strncpy(dst, src, size-1); 19 dst[--size] = '\0';
20 return strncpy(dst, src, size);
20} 21}