summaryrefslogtreecommitdiffstats
path: root/source/lib
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2003-07-23 12:33:59 +0000
committerGerald Carter <jerry@samba.org>2003-07-23 12:33:59 +0000
commit9f835b85dd38cbe655eb19021ff763f31886ac00 (patch)
tree6518cb2e4a60a5418ab1ac362041595687d4d82e /source/lib
parent36bc2b99b4fec2c14f8471d89381b2d6c2f9d339 (diff)
downloadsamba-9f835b85dd38cbe655eb19021ff763f31886ac00.tar.gz
samba-9f835b85dd38cbe655eb19021ff763f31886ac00.tar.xz
samba-9f835b85dd38cbe655eb19021ff763f31886ac00.zip
convert snprintf() calls using pstrings & fstrings
to pstr_sprintf() and fstr_sprintf() to try to standardize. lots of snprintf() calls were using len-1; some were using len. At least this helps to be consistent.
Diffstat (limited to 'source/lib')
-rw-r--r--source/lib/smbldap.c4
-rw-r--r--source/lib/util.c2
-rw-r--r--source/lib/util_sock.c2
3 files changed, 4 insertions, 4 deletions
diff --git a/source/lib/smbldap.c b/source/lib/smbldap.c
index 7c2409312bc..3f56d066ec0 100644
--- a/source/lib/smbldap.c
+++ b/source/lib/smbldap.c
@@ -1197,7 +1197,7 @@ static NTSTATUS add_new_domain_info(struct smbldap_state *ldap_state,
DEBUG(3,("Adding new domain\n"));
ldap_op = LDAP_MOD_ADD;
- snprintf(dn, sizeof(dn), "%s=%s,%s", get_attr_key2string(dominfo_attr_list, LDAP_ATTR_DOMAIN),
+ pstr_sprintf(dn, "%s=%s,%s", get_attr_key2string(dominfo_attr_list, LDAP_ATTR_DOMAIN),
domain_name, lp_ldap_suffix());
/* Free original search */
@@ -1262,7 +1262,7 @@ NTSTATUS smbldap_search_domain_info(struct smbldap_state *ldap_state,
char **attr_list;
int count;
- snprintf(filter, sizeof(filter)-1, "(&(objectClass=%s)(%s=%s))",
+ pstr_sprintf(filter, "(&(objectClass=%s)(%s=%s))",
LDAP_OBJ_DOMINFO,
get_attr_key2string(dominfo_attr_list, LDAP_ATTR_DOMAIN),
domain_name);
diff --git a/source/lib/util.c b/source/lib/util.c
index a7c939fe5a0..bcafad89a55 100644
--- a/source/lib/util.c
+++ b/source/lib/util.c
@@ -2247,7 +2247,7 @@ char *pid_path(const char *name)
char *lib_path(const char *name)
{
static pstring fname;
- snprintf(fname, sizeof(fname), "%s/%s", dyn_LIBDIR, name);
+ fstr_sprintf(fname, "%s/%s", dyn_LIBDIR, name);
return fname;
}
diff --git a/source/lib/util_sock.c b/source/lib/util_sock.c
index 5320b504eb6..b8b84717084 100644
--- a/source/lib/util_sock.c
+++ b/source/lib/util_sock.c
@@ -986,7 +986,7 @@ int create_pipe_sock(const char *socket_dir,
goto out_umask;
}
- snprintf(path, sizeof(path), "%s/%s", socket_dir, socket_name);
+ pstr_sprintf(path, "%s/%s", socket_dir, socket_name);
unlink(path);
memset(&sunaddr, 0, sizeof(sunaddr));