return(False);
}
- memset((char *)&kcreds, 0, sizeof(kcreds));
+ ZERO_STRUCT(kcreds);
kcreds.client = kprinc;
#ifdef HAVE_SIGACTION
struct sigaction act;
- memset(&act, 0, sizeof(act));
+ ZERO_STRUCT(act);
act.sa_handler = handler;
#ifdef SA_RESTART
return False;
}
- memset(p, 0, sizeof(*p));
+ ZERO_STRUCTP(p);
p->open = True;
p->pnum = i;
bitmap_clear(bmap, p->pnum);
- memset(p, 0, sizeof(*p));
+ ZERO_STRUCTP(p);
free(p);
return(False);
}
- memset((char *)&kcreds, 0, sizeof(kcreds));
+ ZERO_STRUCT(kcreds);
kcreds.client = kprinc;
/* add it to the cache */
if ((ptmp = malloc(sizeof (*ptmp))) != NULL) {
- memset(ptmp, '\0', sizeof (*ptmp));
+ ZERO_STRUCTP(ptmp);
ptmp->name = strdup(name);
ptmp->next = printers;
printers = ptmp;
struct in_addr dest_ip;
struct cli_state cli;
- memset(&cli, '\0', sizeof(struct cli_state));
+ ZERO_STRUCT(cli);
if(cli_initialise(&cli) == False) {
DEBUG(0,("modify_trust_password: unable to initialize client connection.\n"));
return False;
return False;
}
- memset(p, 0, sizeof(*p));
+ ZERO_STRUCTP(p);
p->open = True;
p->pnum = i;
bitmap_clear(bmap, p->pnum);
- memset(p, 0, sizeof(*p));
+ ZERO_STRUCTP(p);
free(p);
pipes_open++;
- memset(p, 0, sizeof(*p));
+ ZERO_STRUCTP(p);
p->pnum = i;
p->open = True;
DLIST_REMOVE(Pipes, p);
- memset(p, 0, sizeof(*p));
+ ZERO_STRUCTP(p);
free(p);
conn = (connection_struct *)malloc(sizeof(*conn));
if (!conn) return NULL;
- memset(conn, 0, sizeof(*conn));
+ ZERO_STRUCTP(conn);
conn->cnum = i;
bitmap_set(bmap, i);
bitmap_clear(bmap, conn->cnum);
num_open--;
- memset(conn, 0, sizeof(*conn));
+ ZERO_STRUCTP(conn);
free(conn);
}
*dirpath = 0;
*bad_path = False;
- if(pst)
- memset( (char *)pst, '\0', sizeof(SMB_STRUCT_STAT));
+ if(pst) {
+ ZERO_STRUCTP(pst);
+ }
if(saved_last_component)
*saved_last_component = 0;
fsp = (files_struct *)malloc(sizeof(*fsp));
if (!fsp) return NULL;
- memset(fsp, 0, sizeof(*fsp));
+ ZERO_STRUCTP(fsp);
first_file = (i+1) % MAX_FNUMS;
fd_ptr = (file_fd_struct *)malloc(sizeof(*fd_ptr));
if (!fd_ptr) return NULL;
- memset(fd_ptr, 0, sizeof(*fd_ptr));
+ ZERO_STRUCTP(fd_ptr);
fd_ptr->fdnum = i;
fd_ptr->dev = (SMB_DEV_T)-1;
fd_ptr->fdnum, fd_ptr_used));
/* paranoia */
- memset(fd_ptr, 0, sizeof(*fd_ptr));
+ ZERO_STRUCTP(fd_ptr);
free(fd_ptr);
}
/* this is paranoia, just in case someone tries to reuse the
information */
- memset(fsp, 0, sizeof(*fsp));
+ ZERO_STRUCTP(fsp);
if (fsp == chain_fsp) chain_fsp = NULL;
* see if they were valid.
*/
- memset(&cli, '\0', sizeof(struct cli_state));
+ ZERO_STRUCT(cli);
+
if(cli_initialise(&cli) == False) {
DEBUG(0,("domain_client_validate: unable to initialize client connection.\n"));
return False;
exit(1);
}
- memset(&cli, '\0', sizeof(struct cli_state));
+ ZERO_STRUCT(cli);
if (!cli_initialise(&cli) || !cli_connect(&cli, remote_machine, &ip)) {
fprintf(stderr, "%s: unable to connect to SMB server on machine %s. Error was : %s.\n",