Many changes to reduce complaints from CppCheck. Several latent bugs fixes, but probably some new typos introduced

This commit is contained in:
Gregory Nutt
2014-02-10 18:08:49 -06:00
parent 8b1d3f6698
commit 91b002a043
82 changed files with 1932 additions and 1594 deletions
+112 -109
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -200,7 +200,7 @@ static void parse_args(int argc, char **argv)
fprintf(stderr, "ERROR: Missing option argument, option: %c\n", optopt);
show_usage(argv[0], EXIT_FAILURE);
break;
default:
fprintf(stderr, "ERROR: Unexpected option: %c\n", ch);
show_usage(argv[0], EXIT_FAILURE);
}
+3 -5
View File
@@ -2101,7 +2101,6 @@ static inline char *process_menu(FILE *stream, const char *kconfigdir)
const char *paranum;
char *menuname;
char *token = NULL;
char *ptr;
/* Get the menu information */
@@ -2114,7 +2113,7 @@ static inline char *process_menu(FILE *stream, const char *kconfigdir)
/* Process each line in the choice */
while ((ptr = kconfig_line(stream)) != NULL)
while (kconfig_line(stream) != NULL)
{
/* Process the first token on the Kconfig file line */
@@ -2228,11 +2227,10 @@ static char *parse_kconfigfile(FILE *stream, const char *kconfigdir)
{
enum token_type_e tokid;
char *token = NULL;
char *ptr;
/* Process each line in the Kconfig file */
while ((ptr = kconfig_line(stream)) != NULL)
while (kconfig_line(stream) != NULL)
{
/* Process the first token on the Kconfig file line */
@@ -2475,7 +2473,7 @@ int main(int argc, char **argv, char **envp)
error("Missing option argument, option: %c\n", optopt);
show_usage(argv[0], ERROR_MISSING_OPTION_ARGUMENT);
break;
default:
error("Unexpected option: %c\n", ch);
show_usage(argv[0], ERROR_UNEXPECTED_OPTION);
}
-2
View File
@@ -635,8 +635,6 @@ static char *cywin2windows(const char *str, const char *append, enum slashmode_e
if (append)
{
char *tmp;
alloclen = sizeof(str) + sizeof(append) + 1;
allocpath = (char *)malloc(alloclen);
if (!allocpath)
+1 -1
View File
@@ -148,7 +148,7 @@ int main(int argc, char **argv, char **envp)
fprintf(stderr, "Missing option argument, option: %c\n", optopt);
show_usage(argv[0]);
break;
default:
fprintf(stderr, "Unexpected option: %c\n", ch);
show_usage(argv[0]);
}
+1 -1
View File
@@ -606,7 +606,7 @@ int main(int argc, char **argv, char **envp)
fprintf(stderr, "Missing option argument, option: %c\n", optopt);
show_usage(argv[0]);
break;
default:
fprintf(stderr, "Unexpected option: %c\n", ch);
show_usage(argv[0]);
}