diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2018-08-31 19:02:14 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2018-08-31 19:02:14 -0700 |
commit | 4c35d8ab492620c92a90fccdca4b681512bd00ab (patch) | |
tree | 187e6ae535e5638ada71068ffbefa523b2541784 /utils | |
parent | 1599e2b9f44158c47d266e0af2da7125fc9e8bff (diff) | |
parent | 0a196513162c60f595e1c5cea351900c1eb77019 (diff) | |
download | gps-4c35d8ab492620c92a90fccdca4b681512bd00ab.tar.gz |
Merge "GPS: unify buffer size passed to retrieve string with loc cfg"
Diffstat (limited to 'utils')
-rw-r--r-- | utils/loc_cfg.cpp | 2 | ||||
-rw-r--r-- | utils/loc_cfg.h | 14 |
2 files changed, 8 insertions, 8 deletions
diff --git a/utils/loc_cfg.cpp b/utils/loc_cfg.cpp index d319fb4..8624169 100644 --- a/utils/loc_cfg.cpp +++ b/utils/loc_cfg.cpp @@ -141,7 +141,7 @@ int loc_set_config_entry(const loc_param_s_type* config_entry, loc_param_v_type* else { strlcpy((char*) config_entry->param_ptr, config_value->param_str_value, - LOC_MAX_PARAM_STRING + 1); + LOC_MAX_PARAM_STRING); } /* Log INI values */ LOC_LOGD("%s: PARAM %s = %s", __FUNCTION__, diff --git a/utils/loc_cfg.h b/utils/loc_cfg.h index f0334d0..3057abc 100644 --- a/utils/loc_cfg.h +++ b/utils/loc_cfg.h @@ -37,7 +37,7 @@ #include <grp.h> #define LOC_MAX_PARAM_NAME 80 -#define LOC_MAX_PARAM_STRING 170 +#define LOC_MAX_PARAM_STRING 172 #define LOC_MAX_PARAM_LINE (LOC_MAX_PARAM_NAME + LOC_MAX_PARAM_STRING) #define LOC_FEATURE_MODE_DISABLED "DISABLED" @@ -72,12 +72,12 @@ *============================================================================*/ typedef struct { - const char *param_name; - void *param_ptr; - uint8_t *param_set; /* indicate value set by config file */ - char param_type; /* 'n' for number, - 's' for string, - 'f' for double */ + const char *param_name; + void *param_ptr; /* for string type, buf size need to be LOC_MAX_PARAM_STRING */ + uint8_t *param_set; /* indicate value set by config file */ + char param_type; /* 'n' for number, + 's' for string, NOTE: buf size need to be LOC_MAX_PARAM_STRING + 'f' for double */ } loc_param_s_type; typedef enum { |