From 0a196513162c60f595e1c5cea351900c1eb77019 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Fri, 24 Aug 2018 16:57:57 -0700 Subject: 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 --- utils/loc_cfg.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'utils/loc_cfg.h') 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 #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 { -- cgit v1.2.3