aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authormurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2008-10-09 14:56:51 +0000
committermurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2008-10-09 14:56:51 +0000
commitf0d32fcc57029c07755a1616c1948c1ed9433495 (patch)
treedbc9ae3a6c64f0fdeb58465fce49d4fc6fae7fe0 /main
parentecde53ad3cfed686b0174bfa65574fd452f6e54c (diff)
Merged revisions 147807 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r147807 | murf | 2008-10-09 08:17:33 -0600 (Thu, 09 Oct 2008) | 15 lines (closes issue #13557) Reported by: nickpeirson Patches: pbx.c.patch uploaded by nickpeirson (license 579) replace_bzero+bcopy.patch uploaded by nickpeirson (license 579) Tested by: nickpeirson, murf 1. replaced all refs to bzero and bcopy to memset and memmove instead. 2. added a note to the CODING-GUIDELINES 3. add two macros to asterisk.h to prevent bzero, bcopy from creeping back into the source 4. removed bzero from configure, configure.ac, autoconfig.h.in ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@147809 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/astobj2.c2
-rw-r--r--main/cli.c4
-rw-r--r--main/config.c2
-rw-r--r--main/pbx.c2
-rw-r--r--main/rtp.c4
-rw-r--r--main/translate.c2
6 files changed, 8 insertions, 8 deletions
diff --git a/main/astobj2.c b/main/astobj2.c
index dd48ae924..87dfd0385 100644
--- a/main/astobj2.c
+++ b/main/astobj2.c
@@ -194,7 +194,7 @@ int ao2_ref(void *user_data, const int delta)
/* for safety, zero-out the astobj2 header and also the
* first word of the user-data, which we make sure is always
* allocated. */
- bzero(obj, sizeof(struct astobj2 *) + sizeof(void *) );
+ memset(obj, '\0', sizeof(struct astobj2 *) + sizeof(void *) );
free(obj);
}
diff --git a/main/cli.c b/main/cli.c
index b5ff643dd..6b129bc84 100644
--- a/main/cli.c
+++ b/main/cli.c
@@ -1426,7 +1426,7 @@ static int __ast_cli_unregister(struct ast_cli_entry *e, struct ast_cli_entry *e
e->_full_cmd = NULL;
if (e->handler) {
/* this is a new-style entry. Reset fields and free memory. */
- bzero((char **)(e->cmda), sizeof(e->cmda));
+ memset((char **)(e->cmda), '\0', sizeof(e->cmda));
ast_free(e->command);
e->command = NULL;
e->usage = NULL;
@@ -1444,7 +1444,7 @@ static int __ast_cli_register(struct ast_cli_entry *e, struct ast_cli_entry *ed)
char **dst = (char **)e->cmda; /* need to cast as the entry is readonly */
char *s;
- bzero (&a, sizeof(a));
+ memset(&a, '\0', sizeof(a));
e->handler(e, CLI_INIT, &a);
/* XXX check that usage and command are filled up */
s = ast_skip_blanks(e->command);
diff --git a/main/config.c b/main/config.c
index ddf660d1a..9c96327b0 100644
--- a/main/config.c
+++ b/main/config.c
@@ -2269,7 +2269,7 @@ int ast_parse_arg(const char *arg, enum ast_parse_flags flags,
struct hostent *hp;
struct ast_hostent ahp;
- bzero(&_sa_buf, sizeof(_sa_buf)); /* clear buffer */
+ memset(&_sa_buf, '\0', sizeof(_sa_buf)); /* clear buffer */
/* duplicate the string to strip away the :port */
port = ast_strdupa(arg);
buf = strsep(&port, ":");
diff --git a/main/pbx.c b/main/pbx.c
index 70f1f0c50..8739552d4 100644
--- a/main/pbx.c
+++ b/main/pbx.c
@@ -1719,7 +1719,7 @@ static int ext_cmp1(const char **p)
return 0x40000; /* XXX make this entry go last... */
}
- bzero(chars, sizeof(chars)); /* clear all chars in the set */
+ memset(chars, '\0', sizeof(chars)); /* clear all chars in the set */
for (; *p < end ; (*p)++) {
unsigned char c1, c2; /* first-last char in range */
c1 = (unsigned char)((*p)[0]);
diff --git a/main/rtp.c b/main/rtp.c
index 2c891cdf3..46107e33e 100644
--- a/main/rtp.c
+++ b/main/rtp.c
@@ -625,7 +625,7 @@ int ast_stun_request(int s, struct sockaddr_in *dst,
res = ast_select(s + 1, &rfds, NULL, NULL, &to);
if (res <= 0) /* timeout or error */
continue;
- bzero(&src, sizeof(src));
+ memset(&src, '\0', sizeof(src));
srclen = sizeof(src);
/* XXX pass -1 in the size, because stun_handle_packet might
* write past the end of the buffer.
@@ -637,7 +637,7 @@ int ast_stun_request(int s, struct sockaddr_in *dst,
retry, res);
continue;
}
- bzero(answer, sizeof(struct sockaddr_in));
+ memset(answer, '\0', sizeof(struct sockaddr_in));
stun_handle_packet(s, &src, reply_buf, res,
stun_get_mapped, answer);
res = 0; /* signal regular exit */
diff --git a/main/translate.c b/main/translate.c
index eeeb7cbd1..a38a67024 100644
--- a/main/translate.c
+++ b/main/translate.c
@@ -451,7 +451,7 @@ static void rebuild_matrix(int samples)
ast_debug(1, "Resetting translation matrix\n");
- bzero(tr_matrix, sizeof(tr_matrix));
+ memset(tr_matrix, '\0', sizeof(tr_matrix));
/* first, compute all direct costs */
AST_RWLIST_TRAVERSE(&translators, t, list) {