projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e58db33
)
fix crash with wrong pointer indirection in setup.c
author
Wilfried Goesgens
<dothebart@citadel.org>
Sun, 3 Jul 2011 23:08:30 +0000
(23:08 +0000)
committer
Wilfried Goesgens
<dothebart@citadel.org>
Sun, 4 Sep 2011 21:28:40 +0000
(21:28 +0000)
citadel/utils/setup.c
patch
|
blob
|
history
diff --git
a/citadel/utils/setup.c
b/citadel/utils/setup.c
index ae7b28ecd3a728cf30f359667f3f59bbf5d55387..8f9cd5867ae9949064fb48201479dbc57fca1e19 100644
(file)
--- a/
citadel/utils/setup.c
+++ b/
citadel/utils/setup.c
@@
-1278,17
+1278,17
@@
void GetDefaultValChar(char *WhereTo, const char *VarName, char DefVal)
*WhereTo = atoi(ch);
}
}
*WhereTo = atoi(ch);
}
}
-#define GetDefaultVALSTR(CFGNAME, DEFL) GetDefaultValStr(
(char**)&config.CFGNAME
, sizeof(config.CFGNAME), "CITADEL_"#CFGNAME, DEFL)
-void GetDefaultValStr(char *
*
WhereTo, size_t nMax, const char *VarName, const char *DefVal)
+#define GetDefaultVALSTR(CFGNAME, DEFL) GetDefaultValStr(
&config.CFGNAME[0]
, sizeof(config.CFGNAME), "CITADEL_"#CFGNAME, DEFL)
+void GetDefaultValStr(char *WhereTo, size_t nMax, const char *VarName, const char *DefVal)
{
const char *ch;
{
const char *ch;
- if (*
*
WhereTo == '\0')
- safestrncpy(
*
WhereTo, DefVal, nMax);
+ if (*WhereTo == '\0')
+ safestrncpy(WhereTo, DefVal, nMax);
if ((setup_type == UI_SILENT) &&
(ch = getenv(VarName), ch != NULL))
{
if ((setup_type == UI_SILENT) &&
(ch = getenv(VarName), ch != NULL))
{
- safestrncpy(
*
WhereTo, ch, nMax);
+ safestrncpy(WhereTo, ch, nMax);
}
}
}
}