mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-10-31 10:47:18 +00:00 
			
		
		
		
	Avoid cppcheck warnings; removing unused vars and a bit of cleanup.
Patch by: Clod Patry Review: https://reviewboard.asterisk.org/r/1651 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354429 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
		| @@ -474,7 +474,6 @@ static int file_read(struct ast_channel *chan, const char *cmd, char *data, stru | ||||
| 	int64_t flength, i; /* iterator needs to be signed, so it can go negative and terminate the loop */ | ||||
| 	int64_t offset_offset = -1, length_offset = -1; | ||||
| 	char dos_state = 0; | ||||
| 	size_t readlen; | ||||
| 	AST_DECLARE_APP_ARGS(args, | ||||
| 		AST_APP_ARG(filename); | ||||
| 		AST_APP_ARG(offset); | ||||
| @@ -636,7 +635,7 @@ static int file_read(struct ast_channel *chan, const char *cmd, char *data, stru | ||||
| 				/* Don't let previous values influence current counts, due to short reads */ | ||||
| 				memset(fbuf, 0, sizeof(fbuf)); | ||||
| 			} | ||||
| 			if (fread(fbuf, 1, sizeof(fbuf), ff) && !feof(ff)) { | ||||
| 			if (fread(fbuf, 1, sizeof(fbuf), ff) < sizeof(fbuf) && !feof(ff)) { | ||||
| 				ast_log(LOG_ERROR, "Short read?!!\n"); | ||||
| 				fclose(ff); | ||||
| 				return -1; | ||||
| @@ -688,8 +687,10 @@ static int file_read(struct ast_channel *chan, const char *cmd, char *data, stru | ||||
| 		ast_debug(3, "offset=%" PRId64 ", length=%" PRId64 ", offset_offset=%" PRId64 ", length_offset=%" PRId64 "\n", offset, length, offset_offset, length_offset); | ||||
| 		for (i = offset_offset; i < flength; i += sizeof(fbuf)) { | ||||
| 			char *pos; | ||||
| 			if ((readlen = fread(fbuf, 1, sizeof(fbuf), ff)) < sizeof(fbuf) && !feof(ff)) { | ||||
| 			if (fread(fbuf, 1, sizeof(fbuf), ff) < sizeof(fbuf) && !feof(ff)) { | ||||
| 				ast_log(LOG_ERROR, "Short read?!!\n"); | ||||
| 				fclose(ff); | ||||
| 				return -1; | ||||
| 			} | ||||
| 			for (pos = fbuf; pos < fbuf + sizeof(fbuf); pos++) { | ||||
| 				LINE_COUNTER(pos, format, current_length); | ||||
|   | ||||
| @@ -1504,7 +1504,7 @@ static int unload_module(void) | ||||
| 	AST_RWLIST_WRLOCK(&queries); | ||||
|  | ||||
| 	AST_RWLIST_UNLOCK(&queries); | ||||
| 	return 0; | ||||
| 	return res; | ||||
| } | ||||
|  | ||||
| static int reload(void) | ||||
|   | ||||
| @@ -584,7 +584,6 @@ static int listfilter(struct ast_channel *chan, const char *cmd, char *parse, ch | ||||
| 		AST_APP_ARG(delimiter); | ||||
| 		AST_APP_ARG(fieldvalue); | ||||
| 	); | ||||
| 	const char *ptr; | ||||
| 	struct ast_str *orig_list = ast_str_thread_get(&tmp_buf, 16); | ||||
| 	const char *begin, *cur, *next; | ||||
| 	int dlen, flen, first = 1; | ||||
| @@ -624,7 +623,7 @@ static int listfilter(struct ast_channel *chan, const char *cmd, char *parse, ch | ||||
| 	} | ||||
|  | ||||
| 	/* If the string isn't there, just copy out the string and be done with it. */ | ||||
| 	if (!(ptr = strstr(ast_str_buffer(orig_list), args.fieldvalue))) { | ||||
| 	if (!strstr(ast_str_buffer(orig_list), args.fieldvalue)) { | ||||
| 		if (buf) { | ||||
| 			ast_copy_string(buf, ast_str_buffer(orig_list), len); | ||||
| 		} else { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user