summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2011-05-03 13:10:01 -0700
committerJeremy Allison <jra@samba.org>2011-05-04 12:12:13 -0700
commit017e0c8d95fe8212b006e1c14aef8d96fed30674 (patch)
tree3bb209bc92d298d17255a69713981a7df18d0b8b /source4
parentdeba880986b1029fa059fcfba9b2a72abf598a9b (diff)
downloadsamba-017e0c8d95fe8212b006e1c14aef8d96fed30674.tar.gz
samba-017e0c8d95fe8212b006e1c14aef8d96fed30674.tar.bz2
samba-017e0c8d95fe8212b006e1c14aef8d96fed30674.zip
Fix simple uses of safe_strcpy -> strlcpy. Easy ones where we just remove -1.
Diffstat (limited to 'source4')
-rw-r--r--source4/client/client.c4
-rw-r--r--source4/torture/masktest.c4
-rw-r--r--source4/winbind/wb_server.h2
3 files changed, 5 insertions, 5 deletions
diff --git a/source4/client/client.c b/source4/client/client.c
index 923a6f3a23..a226982296 100644
--- a/source4/client/client.c
+++ b/source4/client/client.c
@@ -473,8 +473,8 @@ static void add_to_do_list_queue(const char* entry)
}
if (do_list_queue)
{
- safe_strcpy(do_list_queue + do_list_queue_end, entry,
- do_list_queue_size - do_list_queue_end - 1);
+ strlcpy(do_list_queue + do_list_queue_end, entry ? entry : "",
+ do_list_queue_size - do_list_queue_end);
do_list_queue_end = new_end;
DEBUG(4,("added %s to do_list_queue (start=%d, end=%d)\n",
entry, (int)do_list_queue_start, (int)do_list_queue_end));
diff --git a/source4/torture/masktest.c b/source4/torture/masktest.c
index bfd1aff5e8..9f156b807b 100644
--- a/source4/torture/masktest.c
+++ b/source4/torture/masktest.c
@@ -175,7 +175,7 @@ static void testpair(TALLOC_CTX *mem_ctx, struct smbcli_state *cli, char *mask,
count++;
- safe_strcpy(res1, "---", sizeof(res1)-1);
+ strlcpy(res1, "---", sizeof(res1));
state.mem_ctx = mem_ctx;
@@ -189,7 +189,7 @@ static void testpair(TALLOC_CTX *mem_ctx, struct smbcli_state *cli, char *mask,
resultp = res1;
short_name = talloc_strdup(mem_ctx, "");
get_real_name(mem_ctx, cli, &long_name, &short_name);
- safe_strcpy(res1, "---", sizeof(res1)-1);
+ strlcpy(res1, "---", sizeof(res1));
smbcli_list_new(cli->tree, mask,
FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_DIRECTORY,
RAW_SEARCH_DATA_BOTH_DIRECTORY_INFO,
diff --git a/source4/winbind/wb_server.h b/source4/winbind/wb_server.h
index f20bc0aa51..12dd1888ed 100644
--- a/source4/winbind/wb_server.h
+++ b/source4/winbind/wb_server.h
@@ -104,7 +104,7 @@ struct wbsrv_connection {
#define WBSRV_SAMBA3_SET_STRING(dest, src) do { \
memset(dest, 0, sizeof(dest));\
- safe_strcpy(dest, src, sizeof(dest)-1);\
+ strlcpy((dest), (src) ? (src) : "", sizeof(dest));\
} while(0)
/*