Browse Source

Init saveptr as NULL for sttor_r()

Serj Kalichev 10 years ago
parent
commit
054be238df
4 changed files with 7 additions and 6 deletions
  1. 1 1
      clish/callback_access.c
  2. 1 1
      clish/shell/shell_command.c
  3. 3 2
      clish/shell/shell_var.c
  4. 2 2
      clish/shell/shell_xml.c

+ 1 - 1
clish/callback_access.c

@@ -34,7 +34,7 @@ bool_t clish_access_callback(const clish_shell_t * shell, const char *access)
 	gid_t *group_list;
 	int i;
 	char *tmp_access, *full_access;
-	char *saveptr;
+	char *saveptr = NULL;
 
 	assert(access);
 	full_access = lub_string_dup(access);

+ 1 - 1
clish/shell/shell_command.c

@@ -123,7 +123,7 @@ void clish_shell_param_generator(clish_shell_t *this, lub_argv_t *matches,
 			/* The 'completion' field of PARAM */
 			if (clish_param__get_completion(param)) {
 				char *str, *q;
-				char *saveptr;
+				char *saveptr = NULL;
 				str = clish_shell_expand(
 					clish_param__get_completion(param), SHELL_VAR_ACTION, &context);
 				if (str) {

+ 3 - 2
clish/shell/shell_var.c

@@ -18,7 +18,8 @@ void clish_shell__expand_viewid(const char *viewid, lub_bintree_t *tree,
 	clish_context_t *context)
 {
 	char *expanded;
-	char *q, *saveptr;
+	char *q;
+	char *saveptr = NULL;
 
 	expanded = clish_shell_expand(viewid, SHELL_VAR_NONE, context);
 	if (!expanded)
@@ -241,7 +242,7 @@ static char *expand_nextsegment(const char **string, const char *escape_chars,
 		if (p[-1] == '}') {
 			bool_t valid = BOOL_FALSE;
 			char *text, *q;
-			char *saveptr;
+			char *saveptr = NULL;
 
 			/* get the variable text */
 			text = lub_string_dupn(tmp, len);

+ 2 - 2
clish/shell/shell_xml.c

@@ -74,7 +74,7 @@ void clish_shell_load_scheme(clish_shell_t *this, const char *xml_path)
 	const char *path = xml_path;
 	char *buffer;
 	char *dirname;
-	char *saveptr;
+	char *saveptr = NULL;
 
 	/* use the default path */
 	if (!path)
@@ -367,7 +367,7 @@ process_command(clish_shell_t * shell, clish_xmlnode_t * element, void *parent)
 
 	/* Reference 'ref' field */
 	if (ref) {
-		char *saveptr;
+		char *saveptr = NULL;
 		const char *delim = "@";
 		char *view_name = NULL;
 		char *cmdn = NULL;