diff --git a/sway/config.c b/sway/config.c index ea9f23dd4..26d22842d 100644 --- a/sway/config.c +++ b/sway/config.c @@ -613,7 +613,9 @@ static int detect_brace(FILE *file) { } } free(line); - fseek(file, pos, SEEK_SET); + if (ret == 0) { + fseek(file, pos, SEEK_SET); + } return ret; }