summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAn-Cheng Huang <ancheng@vyatta.com>2010-05-28 16:11:36 -0700
committerAn-Cheng Huang <ancheng@vyatta.com>2010-05-28 16:11:36 -0700
commitaa2ba10182681dcf4a9d7526b53d6c78ba421263 (patch)
treeb4544274eda0a88cb07dcb37834d53ac9c5e5258 /src
parent754da40f1a9d7ac5a75a9091b67df68e5da29626 (diff)
downloadvyatta-cfg-aa2ba10182681dcf4a9d7526b53d6c78ba421263.tar.gz
vyatta-cfg-aa2ba10182681dcf4a9d7526b53d6c78ba421263.zip
remove unnecessary memset calls
Diffstat (limited to 'src')
-rw-r--r--src/check_tmpl.c1
-rw-r--r--src/cli_val_engine.c2
-rw-r--r--src/delete.c3
-rw-r--r--src/exe_action.c1
-rw-r--r--src/set.c3
5 files changed, 0 insertions, 10 deletions
diff --git a/src/check_tmpl.c b/src/check_tmpl.c
index 109c76b..c1be682 100644
--- a/src/check_tmpl.c
+++ b/src/check_tmpl.c
@@ -44,7 +44,6 @@ main(int argc, char **argv)
exit(-1);
}
- memset(&def, 0, sizeof(def));
status = parse_def(&def, argv[1], 0);
if (status == -5) {
printf("Cannot open [%s]\n", argv[1]);
diff --git a/src/cli_val_engine.c b/src/cli_val_engine.c
index a81f413..f43b521 100644
--- a/src/cli_val_engine.c
+++ b/src/cli_val_engine.c
@@ -259,8 +259,6 @@ static char** clind_get_current_value(clind_path_ref cfg_path,
int fn_node_def_size=strlen(tmpl_path_string)+1+strlen(NODE_DEF)+1;
char* fn_node_def=(char*)malloc(fn_node_def_size);
- memset(&def, 0, sizeof(def));
-
fn_node_def[0]=0;
if(*tmpl_path_string!='/' && root_tmpl_path) {
diff --git a/src/delete.c b/src/delete.c
index 4f38f54..65dd67e 100644
--- a/src/delete.c
+++ b/src/delete.c
@@ -127,7 +127,6 @@ boolean set_validate(vtw_def *defp, char *valp)
bye("Can not set value (2), no definition for %s", m_path.path);
}
/* defniition present */
- memset(defp, 0, sizeof(vtw_def));
if ((status = parse_def(defp, t_path.path, FALSE))) {
bye("parse error: %d\n", status);
}
@@ -242,7 +241,6 @@ int main(int argc, char **argv)
if (lstat(t_path.path, &statbuf) >= 0 &&
(statbuf.st_mode & S_IFMT) == S_IFREG) {
/* defniition present */
- memset(&def, 0, sizeof(vtw_def));
if ((status = parse_def(&def, t_path.path, FALSE))) {
bye("parse error: %d\n", status);
}
@@ -302,7 +300,6 @@ int main(int argc, char **argv)
bye("Can not delete value, no definition for %s", m_path.path);
}
/* defniition present */
- memset(&def, 0, sizeof(vtw_def));
if ((status = parse_def(&def, t_path.path, FALSE))) {
bye("parse error: %d\n", status);
}
diff --git a/src/exe_action.c b/src/exe_action.c
index ee884c3..77d6a87 100644
--- a/src/exe_action.c
+++ b/src/exe_action.c
@@ -87,7 +87,6 @@ main(int argc, char** argv)
printf("[path: %s][act: %lu]\n",buf,act);
if ((lstat(buf,&s) == 0) && S_ISREG(s.st_mode)) {
- memset(&def, 0, sizeof(def));
if (parse_def(&def,buf,FALSE) == 0) {
//execute
int status;
diff --git a/src/set.c b/src/set.c
index 42e84ec..909cb74 100644
--- a/src/set.c
+++ b/src/set.c
@@ -67,7 +67,6 @@ boolean set_validate(vtw_def *defp, char *valp, boolean empty_val)
m_path.path,t_path.path);
}
/* defniition present */
- memset(defp, 0, sizeof(vtw_def));
if ((status = parse_def(defp, t_path.path, FALSE))) {
bye("parse error: %d\n", status);
}
@@ -256,7 +255,6 @@ int main(int argc, char **argv)
/* prevent value node without actual value */
push_path(&t_path, DEF_NAME);
if (lstat(t_path.path, &statbuf) >= 0) {
- memset(&def, 0, sizeof(vtw_def));
if ((status = parse_def(&def, t_path.path, FALSE))) {
bye("parse error: %d\n", status);
}
@@ -424,7 +422,6 @@ handle_default(vtw_path *mpath, vtw_path *tpath, char *exclude)
pop_path(tpath); /* child */
continue;
}
- memset(&def, 0, sizeof(def));
if ((status = parse_def(&def, tpath->path, FALSE))) {
/* template parse error. abort. */
bye("Parse error in [%s]\n", tpath->path);