Skip to content

Commit 8e81d83

Browse files
committed
Fix discarted qualifiers warning
Signed-off-by: anna <anna@navirc.com>
1 parent ef2ce86 commit 8e81d83

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/librc/librc.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,8 @@ rc_sys(void)
353353
char *
354354
rc_sysconfdir_get(void) {
355355
static char path[PATH_MAX] = { 0 };
356-
if (geteuid() != 0) {
357-
if (!*path) {
356+
if (!*path) {
357+
if (geteuid() != 0) {
358358
char *config_path;
359359
if ((config_path = getenv("XDG_CONFIG_HOME"))) {
360360
snprintf(path, PATH_MAX, "%s", config_path);
@@ -363,18 +363,18 @@ rc_sysconfdir_get(void) {
363363
} else {
364364
exit(1);
365365
}
366+
} else {
367+
snprintf(path, PATH_MAX, "%s", RC_SYSCONFDIR);
366368
}
367-
return path;
368-
} else {
369-
return RC_SYSCONFDIR;
370369
}
370+
return path;
371371
}
372372

373373
char *
374374
rc_svcdir_get(void) {
375375
static char path[PATH_MAX] = { 0 };
376-
if (geteuid() != 0) {
377-
if (!*path) {
376+
if (!*path) {
377+
if (geteuid() != 0) {
378378
char *config_path;
379379
if ((config_path = getenv("XDG_RUNTIME_DIR")) ||
380380
(config_path = getenv("XDG_DATA_HOME"))) {
@@ -385,11 +385,11 @@ rc_svcdir_get(void) {
385385
} else {
386386
exit(1);
387387
}
388+
} else {
389+
snprintf(path, PATH_MAX, "%s", RC_SVCDIR);
388390
}
389-
return path;
390-
} else {
391-
return RC_SVCDIR;
392391
}
392+
return path;
393393
}
394394

395395
char *

0 commit comments

Comments
 (0)