diff options
author | 2019-09-07 04:33:35 -0400 | |
---|---|---|
committer | 2019-09-07 11:03:12 +0000 | |
commit | d0d0c2fb41c2e61b69b5dc9e38f3e60843f4388d (patch) | |
tree | 2e08fe87af01e2d4fba0ae1c0af4873f7beac7ad /veslibrary/ves_clibrary/evel/evel-library/code/evel_library/evel_scaling_measurement.c | |
parent | 998c19266ef5f74fffd79e9c0c0a65f77ff19a43 (diff) |
Change the for loop initial declarations to avoid adding -std=c99 in CFLAGS.
As strdup() provided by POSIX returns "address out of bould" in C99 mode, which may cause program crash.
Issue-ID: VNFSDK-465
Signed-off-by: YatianXU <yatian.xu@nokia-sbell.com>
Change-Id: I57f55edd939d64c2e201a345fe83659048308d50
Diffstat (limited to 'veslibrary/ves_clibrary/evel/evel-library/code/evel_library/evel_scaling_measurement.c')
-rw-r--r-- | veslibrary/ves_clibrary/evel/evel-library/code/evel_library/evel_scaling_measurement.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/veslibrary/ves_clibrary/evel/evel-library/code/evel_library/evel_scaling_measurement.c b/veslibrary/ves_clibrary/evel/evel-library/code/evel_library/evel_scaling_measurement.c index d0d31dd..abda05e 100644 --- a/veslibrary/ves_clibrary/evel/evel-library/code/evel_library/evel_scaling_measurement.c +++ b/veslibrary/ves_clibrary/evel/evel-library/code/evel_library/evel_scaling_measurement.c @@ -5107,8 +5107,8 @@ void evel_json_encode_measurement(EVEL_JSON_BUFFER * jbuf, evel_json_checkpoint(jbuf); if (evel_json_open_opt_named_object(jbuf, "additionalFields")) { - - for(unsigned int idx = 0; idx < ht->size; idx++ ) + unsigned int idx = 0; + for(; idx < ht->size; idx++ ) { /*****************************************************************/ /* Get the first entry of a particular Key and loop through the */ @@ -5656,7 +5656,8 @@ void evel_json_encode_measurement(EVEL_JSON_BUFFER * jbuf, evel_json_checkpoint(jbuf); if (evel_json_open_opt_named_object(jbuf, "featureUsageArray")) { - for(unsigned int idx = 0; idx < ht->size; idx++ ) + unsigned int idx = 0; + for(; idx < ht->size; idx++ ) { /*****************************************************************/ /* Get the first entry of a particular Key and loop through the */ @@ -5755,8 +5756,8 @@ void evel_json_encode_measurement(EVEL_JSON_BUFFER * jbuf, if (evel_json_open_opt_named_object(jbuf, "hashMap")) { - - for(unsigned int idx = 0; idx < ht->size; idx++ ) + unsigned int idx = 0; + for(; idx < ht->size; idx++ ) { /*****************************************************************/ /* Get the first entry of a particular Key and loop through the */ |