svn commit: samba r11445 - in trunk/source: lib rpc_parse

jra at samba.org jra at samba.org
Tue Nov 1 23:28:54 GMT 2005


Author: jra
Date: 2005-11-01 23:28:48 +0000 (Tue, 01 Nov 2005)
New Revision: 11445

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11445

Log:
Remove unused fn. Remove unneeded strncpy use.
Jeremy.

Modified:
   trunk/source/lib/util.c
   trunk/source/rpc_parse/parse_prs.c


Changeset:
Modified: trunk/source/lib/util.c
===================================================================
--- trunk/source/lib/util.c	2005-11-01 19:25:07 UTC (rev 11444)
+++ trunk/source/lib/util.c	2005-11-01 23:28:48 UTC (rev 11445)
@@ -1356,12 +1356,8 @@
   	} 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 @@
 
 	/* 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) {

Modified: trunk/source/rpc_parse/parse_prs.c
===================================================================
--- trunk/source/rpc_parse/parse_prs.c	2005-11-01 19:25:07 UTC (rev 11444)
+++ trunk/source/rpc_parse/parse_prs.c	2005-11-01 23:28:48 UTC (rev 11445)
@@ -1274,32 +1274,6 @@
 	return True;
 }
 
-BOOL prs_string_alloc(const char *name, prs_struct *ps, int depth,
-		      const char **str)
-{
-	size_t len;
-	char *tmp_str;
-
-	if (UNMARSHALLING(ps))
-		len = strlen(&ps->data_p[ps->data_offset]);
-	else
-		len = strlen(*str);
-
-	tmp_str = PRS_ALLOC_MEM(ps, char, len+1);
-
-	if (tmp_str == NULL)
-		return False;
-
-	if (MARSHALLING(ps))
-		strncpy(tmp_str, *str, len);
-
-	if (!prs_string(name, ps, depth, tmp_str, len+1))
-		return False;
-
-	*str = tmp_str;
-	return True;
-}
-
 /*******************************************************************
  prs_uint16 wrapper. Call this and it sets up a pointer to where the
  uint16 should be stored, or gets the size if reading.



More information about the samba-cvs mailing list