diff options
author | Amber Bhardwaj <amber.bhardwaj10@gmail.com> | 2017-06-16 11:08:42 +0530 |
---|---|---|
committer | Christoph Lipka <clipka@users.noreply.github.com> | 2017-06-16 07:38:42 +0200 |
commit | cf65615d35b7c0d3cae3239c53374d841d9a175d (patch) | |
tree | 16693b958e879a36c737cb50f13fa5b3ae8e7ce2 /src/kpi/dlt-kpi-options.c | |
parent | b91b38534e5276db69ffbf938177c227b01c65ad (diff) | |
download | DLT-daemon-cf65615d35b7c0d3cae3239c53374d841d9a175d.tar.gz |
Input parameter check & Error message modification (#15)
* Update dlt-kpi-process.c
Added input param checking and added return value in non-void functions.
* Update dlt-kpi.c
Added Input param checking and added return values in non-void functions.
* Input parameter check and Error msg modification
Added null pointer checking
Added input parameter checking
Added return values in non-void functions
Added proper error message for debugging purpose
Signed-off-by: amberbhardwaj <amber.bhardwaj10@gmail.com>
Diffstat (limited to 'src/kpi/dlt-kpi-options.c')
-rw-r--r-- | src/kpi/dlt-kpi-options.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/kpi/dlt-kpi-options.c b/src/kpi/dlt-kpi-options.c index dda36dc..ea15961 100644 --- a/src/kpi/dlt-kpi-options.c +++ b/src/kpi/dlt-kpi-options.c @@ -63,7 +63,7 @@ DltReturnValue dlt_kpi_read_command_line(DltKpiOptions *options, int argc, char { if(options == NULL) { - fprintf(stderr, "dlt_kpi_read_command_line(): Nullpointer parameter\n"); + fprintf(stderr, "%s: Nullpointer parameter\n", __func__); return DLT_RETURN_WRONG_PARAMETER; } dlt_kpi_init_cli_options(options); @@ -122,7 +122,7 @@ DltReturnValue dlt_kpi_read_configuration_file(DltKpiConfig *config, char *file_ if(config == NULL || file_name == NULL) { - fprintf(stderr, "Nullpointer parameter!\n"); + fprintf(stderr, "%s: Nullpointer parameter!\n", __func__); return DLT_RETURN_WRONG_PARAMETER; } @@ -132,25 +132,25 @@ DltReturnValue dlt_kpi_read_configuration_file(DltKpiConfig *config, char *file_ if(file == NULL) { - fprintf(stderr, "Could not open configuration file!\n"); + fprintf(stderr, "%s: Could not open configuration file!\n", __func__); return DLT_RETURN_ERROR; } if((line = malloc(COMMAND_LINE_SIZE)) == 0) { - fprintf(stderr, "Out of memory!\n"); + fprintf(stderr, "%s: Out of memory!\n", __func__); return DLT_RETURN_ERROR; } if((token = malloc(COMMAND_LINE_SIZE)) == 0) { - fprintf(stderr, "Out of memory!\n"); + fprintf(stderr, "%s: Out of memory!\n", __func__); return DLT_RETURN_ERROR; } if((value = malloc(COMMAND_LINE_SIZE)) == 0) { - fprintf(stderr, "Out of memory!\n"); + fprintf(stderr, "%s: Out of memory!\n", __func__); return DLT_RETURN_ERROR; } @@ -237,7 +237,7 @@ DltReturnValue dlt_kpi_init(int argc, char **argv, DltKpiConfig *config) if(config == NULL) { - fprintf(stderr, "Nullpointer parameter!"); + fprintf(stderr, "%s: Invalid Parameter!", __func__); return DLT_RETURN_WRONG_PARAMETER; } |