mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-03 09:01:40 -05:00
Fix gcc string truncation warnings
This commit is contained in:
parent
99b92b4104
commit
555206cf60
5 changed files with 11 additions and 5 deletions
|
|
@ -418,7 +418,10 @@ struct roots_config *roots_config_create_from_args(int argc, char *argv[]) {
|
|||
char cwd[MAXPATHLEN];
|
||||
if (getcwd(cwd, sizeof(cwd)) != NULL) {
|
||||
char buf[MAXPATHLEN];
|
||||
snprintf(buf, MAXPATHLEN, "%s/%s", cwd, "rootston.ini");
|
||||
if (snprintf(buf, MAXPATHLEN, "%s/%s", cwd, "rootston.ini") >= MAXPATHLEN) {
|
||||
wlr_log(L_ERROR, "config path too long");
|
||||
exit(1);
|
||||
}
|
||||
config->config_path = strdup(buf);
|
||||
} else {
|
||||
wlr_log(L_ERROR, "could not get cwd");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue