summaryrefslogtreecommitdiff
path: root/source3/lib/util.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2005-11-01 23:29:02 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:05:16 -0500
commit9d4760d1190b907010d67dd938be568b776329b8 (patch)
tree97589bf299fa04b20c0f7062b780932ff39a1560 /source3/lib/util.c
parent6fc9564c337af90f3486ec5fd14924204f5784cf (diff)
downloadsamba-9d4760d1190b907010d67dd938be568b776329b8.tar.gz
samba-9d4760d1190b907010d67dd938be568b776329b8.tar.bz2
samba-9d4760d1190b907010d67dd938be568b776329b8.zip
r11446: Remove unused fn. Remove unneeded strncpy use.
Jeremy. (This used to be commit d202aae3c821f3d78ff063d867bac1f84dca3548)
Diffstat (limited to 'source3/lib/util.c')
-rw-r--r--source3/lib/util.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c
index 6b97491039..677871e2d0 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -1356,12 +1356,8 @@ char *automount_lookup(const char *user_name)
} else {
if ((nis_error = yp_match(nis_domain, nis_map, user_name, strlen(user_name),
&nis_result, &nis_result_len)) == 0) {
- if (!nis_error && nis_result_len >= sizeof(pstring)) {
- nis_result_len = sizeof(pstring)-1;
- }
fstrcpy(last_key, user_name);
- strncpy(last_value, nis_result, nis_result_len);
- last_value[nis_result_len] = '\0';
+ pstrcpy(last_value, nis_result);
strip_mount_options(&last_value);
} else if(nis_error == YPERR_KEY) {
@@ -1682,8 +1678,7 @@ BOOL is_in_path(const char *name, name_compare_entry *namelist, BOOL case_sensit
/* Get the last component of the unix name. */
p = strrchr_m(name, '/');
- strncpy(last_component, p ? ++p : name, sizeof(last_component)-1);
- last_component[sizeof(last_component)-1] = '\0';
+ pstrcpy(last_component, p ? ++p : name);
for(; namelist->name != NULL; namelist++) {
if(namelist->is_wild) {