summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim McDonough <jmcd@samba.org>2002-01-15 17:58:59 +0000
committerJim McDonough <jmcd@samba.org>2002-01-15 17:58:59 +0000
commitb5f5861225ad0376e38ca20141089076e1cc84e1 (patch)
tree67cef37198b0d61b7a7d26ed03a876845510a1d1
parent5fa0da0ba5e466eb5fe5f423393ae45dcd4d7237 (diff)
downloadsamba-b5f5861225ad0376e38ca20141089076e1cc84e1.tar.gz
samba-b5f5861225ad0376e38ca20141089076e1cc84e1.tar.bz2
samba-b5f5861225ad0376e38ca20141089076e1cc84e1.zip
Fix from 2.2. It didn't break on HEAD because it isn't being compiled. Herb?
(This used to be commit 4fcaec53de18220ff6662f62a1430f67757cdcc5)
-rw-r--r--source3/nsswitch/winbindd_wins.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/source3/nsswitch/winbindd_wins.c b/source3/nsswitch/winbindd_wins.c
index 04200d6f47..c568a3439e 100644
--- a/source3/nsswitch/winbindd_wins.c
+++ b/source3/nsswitch/winbindd_wins.c
@@ -135,15 +135,15 @@ enum winbindd_result winbindd_wins_byip(struct winbindd_cli_state *state)
*response = '\0';
len = sizeof(response) - 2;
- if ( status = lookup_byaddr_backend(state->request.data.name, &count)) {
+ if ((status = lookup_byaddr_backend(state->request.data.name, &count))){
size = strlen(state->request.data.name) + 1;
if (size > len) {
SAFE_FREE(status);
return WINBINDD_ERROR;
}
len -= size;
- strncat(response,state->request.data.name,size);
- strncat(response,"\t",1);
+ safe_strcat(response,state->request.data.name,size);
+ safe_strcat(response,"\t",1);
for (i = 0; i < count; i++) {
/* ignore group names */
if (status[i].flags & 0x80) continue;
@@ -154,8 +154,8 @@ enum winbindd_result winbindd_wins_byip(struct winbindd_cli_state *state)
return WINBINDD_ERROR;
}
len -= size;
- strncat(response, status[i].name, size);
- strncat(response, " ", 1);
+ safe_strcat(response, status[i].name, size);
+ safe_strcat(response, " ", 1);
}
}
response[strlen(response)-1] = '\n';
@@ -180,7 +180,7 @@ enum winbindd_result winbindd_wins_byname(struct winbindd_cli_state *state)
*response = '\0';
len = sizeof(response) - 2;
- if (ip_list = lookup_byname_backend(state->request.data.name, &count)) {
+ if ((ip_list = lookup_byname_backend(state->request.data.name,&count))){
for (i = count; i ; i--) {
addr = inet_ntoa(ip_list[i-1]);
size = strlen(addr) + 1;
@@ -191,16 +191,16 @@ enum winbindd_result winbindd_wins_byname(struct winbindd_cli_state *state)
len -= size;
if (i != 0)
response[strlen(response)-1] = ' ';
- strncat(response,addr,size);
- strncat(response,"\t",1);
+ safe_strcat(response,addr,size);
+ safe_strcat(response,"\t",1);
}
size = strlen(state->request.data.name) + 1;
if (size > len) {
SAFE_FREE(ip_list);
return WINBINDD_ERROR;
}
- strncat(response,state->request.data.name,size);
- strncat(response,"\n",1);
+ safe_strcat(response,state->request.data.name,size);
+ safe_strcat(response,"\n",1);
SAFE_FREE(ip_list);
} else
return WINBINDD_ERROR;