mirror of
https://github.com/postgres/postgres.git
synced 2025-10-18 04:29:09 +03:00
Cosmetic improvements in new config_info code.
Coverity griped about use of unchecked strcpy() into a local variable. There's unlikely to be any actual bug there, since no caller would be passing a path longer than MAXPGPATH, but nonetheless use of strlcpy() seems preferable. While at it, get rid of unmaintainable separation between list of field names and list of field values in favor of initializing them in parallel. And we might as well declare get_configdata()'s path argument as const char *, even though no current caller needs that.
This commit is contained in:
@@ -15,7 +15,7 @@ typedef struct ConfigData
|
||||
char *setting;
|
||||
} ConfigData;
|
||||
|
||||
extern ConfigData *get_configdata(char *my_exec_path,
|
||||
extern ConfigData *get_configdata(const char *my_exec_path,
|
||||
size_t *configdata_len);
|
||||
|
||||
#endif /* COMMON_CONFIG_INFO_H */
|
||||
|
Reference in New Issue
Block a user