mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-30 15:30:11 +01:00
ifcfg-rh: fix warning about duplicate const when declaring string
clang warns:
make[7]: Entering directory `./NetworkManager/src/settings/plugins/ifcfg-rh'
CC writer.lo
writer.c:2505:20: error: duplicate 'const' declaration specifier [-Werror,-Wduplicate-decl-specifier]
static const char const as_dash[] = "\\][|/=()!";
^~~~~~
CC utils.lo
utils.c:40:20: error: duplicate 'const' declaration specifier [-Werror,-Wduplicate-decl-specifier]
static const char const drop_chars[] = "\r\n"; /* drop CR and LF */
^~~~~~
Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
parent
e543909afc
commit
4ca6274e2b
2 changed files with 2 additions and 3 deletions
|
|
@ -37,7 +37,7 @@
|
|||
char *
|
||||
utils_single_quote_string (const char *str)
|
||||
{
|
||||
static const char const drop_chars[] = "\r\n"; /* drop CR and LF */
|
||||
static const char *drop_chars = "\r\n"; /* drop CR and LF */
|
||||
static const char escape_char = '\\'; /* escape char is backslash */
|
||||
static const char quote_char = '\''; /* quote char is single quote */
|
||||
size_t i, slen, j = 0;
|
||||
|
|
|
|||
|
|
@ -2502,7 +2502,6 @@ error:
|
|||
static char *
|
||||
escape_id (const char *id)
|
||||
{
|
||||
static const char const as_dash[] = "\\][|/=()!";
|
||||
char *escaped = g_strdup (id);
|
||||
char *p = escaped;
|
||||
|
||||
|
|
@ -2510,7 +2509,7 @@ escape_id (const char *id)
|
|||
while (*p) {
|
||||
if (*p == ' ')
|
||||
*p = '_';
|
||||
else if (strchr (as_dash, *p))
|
||||
else if (strchr ("\\][|/=()!", *p))
|
||||
*p = '-';
|
||||
p++;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue