diff options
author | Kevin Tang <zhikait@codeaurora.org> | 2018-08-24 16:57:57 -0700 |
---|---|---|
committer | Kevin Tang <zhikait@codeaurora.org> | 2018-08-24 16:57:57 -0700 |
commit | 0a196513162c60f595e1c5cea351900c1eb77019 (patch) | |
tree | fd0d37293908d8d3808dff0ba161eac1dc209d7e /utils/loc_cfg.h | |
parent | d2980eb906a57d6d2179786d35f681178c76a4b9 (diff) | |
download | gps-0a196513162c60f595e1c5cea351900c1eb77019.tar.gz |
GPS: unify buffer size passed to retrieve string with loc cfg
Loc cfg parsing routines assuming that string buffer size is
LOC_MAX_PARAM_STRING. Changes are to make sure that
caller to loc cfg routine does use that buffer of size
LOC_MAX_PARAM_STRING.
Change-Id: Icecf6bf017e6dda1da0766adc746f60d471653d0
CRs-fixed: 2301437
Diffstat (limited to 'utils/loc_cfg.h')
-rw-r--r-- | utils/loc_cfg.h | 14 |
1 files changed, 7 insertions, 7 deletions
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 { |